View Full Version : Problems uploading large files
September 24th, 2006, 06:51 PM
I've been trying to figure out how I can allow users to upload large files and have the system resize them automatically.
I seem to be going circles. On the large files, GD2 and memory tweaks, just weren't cutting it. So, it sounded like switching to ImageMagik would resolve it. I did that.
Config is: /usr/bin/mogrify (seems right, as I get .mgk files in the data directory)
Maximium width of preview image on showpoduct page = 400
Maximium height of preview image on showpoduct page = 300
Max supersize = 600
If product upload width or height exceeds maximums, resize upload down to max dimensions? YES
Maximum PHP file upload size? 7000000
If I try to upload a 515KB file, at 2048x1536 (a relatively small file)
It does NOT resize the image! I get the full image uploaded.
I've always used GD2 before and am not used to using ImageMagik.
Please help! :o
September 24th, 2006, 07:11 PM
what do you mean you always get the full size image?
Link to install?
If I upload a file bigger than my supersize etc my supersize is resized to supersize max the preview image is the correct size and my thumb also.
September 24th, 2006, 07:25 PM
Okay. I put in a bunch of echo statements to try to narrow down the problem. Of course, you'll probably come back and tell me I've got some real obvious problem.
But here are the pretty self-explanatory results.
This is all from image-inc.php in the create_thumb function:
in create_thumb: type=2, w=2048, h=1536
in create_thumb: resizeorig=1, supermax=600
in create_thumb: maxh=300, maxw=400, new-wid=400, new-h=300, filepath=/home/gphome/public_html/ads/data/2/cage2.jpg
in create_thumb: syscmd="/usr/bin/mogrify" -quality 70 -geometry 400x300 /home/gphome/public_html/ads/data/2/cage2.jpg retval for fs_exec to resize original: 0
in create_thumb: syscmd="/usr/bin/mogrify" -quality 70 -geometry 600x450 '/home/gphome/public_html/ads/data/2/large/cage2.jpg', retval for fs_exec to resize original =0
in create_thumb: syscmd="/usr/bin/mogrify" -size 90x68 -quality 70 -geometry 90x68 /home/gphome/public_html/ads/data/2/thumbs/cage2.jpg and retval=0 for fs_exec to create thumb
So while it SEEMS like it is passing all the right info and I know it is calling mogrify, it is not executing successfully.
Why, I have no clue.
I hope this helps narrow down the problem.
Also, files are being added to directories, so it is not a permissions problem. In fact, in each directory, I get cage2.jpg and cage2.mgk, with the mgk files being about 14K in size.
However, I do see that if I rename the mgk files to jpgs, they are the properly sized files.
September 24th, 2006, 07:34 PM
September 24th, 2006, 07:39 PM
You can PM me an admin login and if you want PHP info
Is safe mode on?
Is your directory permissions all 777 within data?
September 24th, 2006, 07:42 PM
I can't remember where you look for safe mode, but I'm pretty sure not.
Permissions on Data directories are all 777.
Will PM you login.
September 24th, 2006, 08:08 PM
well yes your install is all hacked up but your issue is easy
Your missing this query from your database
INSERT INTO cp_settings VALUES (142,'Acceptable image file types?', 'acceptimg', 'Seperate file types by a comma and include the . (example: .jpg,.gif,.png)', '.jpg,.jpeg,.png,.gif', 89, 3);
September 24th, 2006, 08:30 PM
I know I've made a lot of modifications. I've talked about them elsewhere. But, I'm careful about what I ask for support on.
I'm not sure how you came to the conclusion that that record is missing in the table. That's from the install, right? When I look at that file, the record is there exactly as it's supposed to be in the cp_settings table. Perhaps you just added it for me? If so, I'm still having the same problem.
September 24th, 2006, 08:40 PM
I'll work through it. Somehow the files are not getting renamed from the mgk version.
September 24th, 2006, 09:06 PM
Okay, I've gone into more detail on everything. The cp_settings are actually fine. That code is executing. The issue seems to be that ImageMagik is naming the newly sized files with extensions of .mgk and I really don't quite understand when, where or how those files are supposed to replace the originals.
As I said, my data directories all contain two versions of each file name. The .jpg version and the .mgk version.
For example, after create_thumb executes, I have:
The variables are
Which I believe is fine. So at that point, somehow those mgk extensions still need to be renamed somewhere.
September 24th, 2006, 09:56 PM
If you can just tell me whether or not the the call to imagemagick (ie, mogrify) is supposed to return the same file name or if it's supposed to get renamed elsewhere in the classifieds script, that would be helpful. If it's supposed to change the original file, then I'll pursue debugging my command with ImageMagick.
September 25th, 2006, 01:58 AM
Well after a TON of research on the net, reading all about ImageMagick and Mogrify, making damn sure it wasn't my problem in the script, I came across this little page which is my EXACT problem:
Turns out my host has Version 5.4.7 of ImageMagick installed. I've put in a support ticket for them to upgrade to 6.2. I'm hoping that will solve the problem.
September 25th, 2006, 08:57 AM
You where missing the available image types as noted since in your admin upload options it was not located there that is why I told you that was missing and is exactly why GD2 did not work for you
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.