PDA

View Full Version : Problem with thumb/microthumb generation


cferrero
13th of April 2005 (Wed), 14:44
I'm having some trouble getting IM to create microthumbs and thumbs from mobile phone pics: 352x288 pixels in size.

The resize method I have uses Imagemagick, with 100% resizing (i.e. sizes are preserved). No sharpening. Remove profiles is checked.

If I use this method in an associated path, I get an IM error:

msg 3946 | imagemagick: IMAGEMAGICK COMMAND | /usr/bin/convert -size 43x35 UPLOAD/Image005.jpg -resize 43x35! +profile '*' -unsharp 0.6x0.7+2+0.1 -quality 67 UPLOAD/ee_temp_upload/Image005.jpg
IMAGEMAGICK ERROR:

POSSIBLE REASONS:
SAFE MODE ON? EE can not use ImageMagick when is it located outside PHP safe mode exec dir.
IMAGE IS EMPTY? Perhaps source image was zero size.
IMAGEMAGICK PATH CHANGED? Maybe your server admin has moved IM to another location.
FOLDER PERMISSIONS WRONG? check that UPLOAD folder and all folders inside it are chmod 0777 (full permissions)


If I use *exactly* the same resize method, but check the Watermark option, IM works fine and creates both thumb and microthumb correctly.

This example shows what I mean:
http://www.cferrero.net/gallery/list.php?exhibition=9&pass=public&lang=eng

Test1 and Test3 were uploaded with the watermark option checked. Test2 was uploaded without the watermark option.

Note that this problem only occurs with small images...if I upload an 800x600, for instance, microthumbs/thumbs work fine whether I have watermarking checked or not. Test4 in that gallery is a standard 800x600 image, uploaded using the same resize method, watermark option unchecked.

Any ideas?

Pekka
13th of April 2005 (Wed), 15:28
The resize is a different process than watermarking. This is why when resize fails, the watermark code actually works on full size image. Why the resize fails on small images must be an imagemagick memory management bug - I have seen such very odd behaviour with some IM installations - may be kernel related, who knows.

Try if "remove profiles" or sharpening on/off has anything to do with resize failure - i.e.make resize method as simple as possible for testing. Try also rethumbnailer, does it work?.

cferrero
14th of April 2005 (Thu), 02:06
1. Rethumbnail does not work.
2. Remove profiles on/off makes no difference.
3. Sharpen on/off makes no difference.

I'll have a hunt on ImageMagick FAQs and see if I can find anything. The other solution is just to use a 1pixel transparent watermark, I guess.

Pekka
14th of April 2005 (Thu), 05:17
One question: Do you have Imagemagick thumbs watermarking set "before resize & sharpen" or "after resize & sharpen"?

cferrero
14th of April 2005 (Thu), 07:03
I had it set to 'before', but I just tested 'after' and that makes no difference.

Pekka
14th of April 2005 (Thu), 07:33
Ok, what about Imagemagick test (on resize methods page). Does it give you wrong size, too?

Pekka
14th of April 2005 (Thu), 07:43
Try the attached file (rename old one and upload this there). Any difference? (This affects only upload, not the tests).

cferrero
15th of April 2005 (Fri), 05:05
Ok, what about Imagemagick test (on resize methods page). Does it give you wrong size, too?
Do you mean the 'PREVIEW THIS SIZE NOW' link? They work fine for all the methods I've set up. I'll try the file you post now...

cferrero
15th of April 2005 (Fri), 05:10
Woohoo! The new RESIZE_imagemagick.php fixed the problem...see Image009 on http://www.cferrero.net/gallery/list.php?exhibition=9&pass=public

Thanks Pekka. :):):)

Pekka
15th of April 2005 (Fri), 05:40
OK, good, I suspected that was a problem. The new IM code you got was initially designed to make watermark quality much better (JPEG conversion only as last step) and be overall more reliable (works internally on MIFF image format), it was taken from next EE.