PDA

View Full Version : ImageMagick error


raublekick
10-9-09, 02:30 PM
Hello,
I'm using the Yet Another Photoblog plugin on my Wordpress site. This plugin uses ImageMagick to resize photos. Fortunately ImageMagick is installed.

The URL for this instance is:
http://protobog.good-evil.net

I am getting errors on the images. After I set up the site, I tested it with a new post and it all worked fine. You can still see that first post just fine. All the thumbnails and the image show up fine even when I clear the thumbnail cache. However any new posts/images are failing. If you right click on one of the images and click "View Image" you can see the PHP debugging output for the script that is being called.

Here is the output for one of the images:

Thumbnail generation unsuccessful

{large error report delete}

ImageMagick doesn't seem to think the file exists for some reason. The file is there though so I'm not sure why it can't read it.

Any insight would be helpful. I contacted support but since I am using a 3rd party plugin they closed my ticket without any real help, telling me to contact t he 3rd party. But the problem is with ImageMagick on the server, not the plugin.

IanS
10-9-09, 03:14 PM
I removed the long list of error reports as they contained user specific data which we don't show here on these forums. Please also encase them in [code] or other tags to reduce the size of the post.

Croc Hunter
10-9-09, 03:37 PM
It might seem unlikely but it sure looks like the plugin. I sped read your full post.
I'm guessing it's a flaw with using Flash to upload files. Ensure 755 on folders and 644 files.
Trying a similar plugin that's works might be fastest.

-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=9&w=302&h=150&q=80&zc=1
-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=22&q=100&w=100&h=100&zc=1

raublekick
10-9-09, 03:53 PM
It might seem unlikely but it sure looks like the plugin. I'm guessing it's a flaw with using Flash to upload files.

-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=9&w=302&h=150&q=80&zc=1
-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=22&q=100&w=100&h=100&zc=1

The files are being uploaded fine. The error is specifically with ImageMagick trying to resize them. All the files exist on the server, but the plugin resizes them when you view the post. The problem is well after the post has already been created and the files uploaded.

The way the plugin works is that you attach a photo to it, and it uploads the photo when you save the post. Again, this part is working fine. When you view a post, the plugin doesn't link directly to the image itself, it puts a URL in the image tag to a script that resizes and creates a thumbnail (or grabs a chached thumbnail). Everything is fine up to the point where the convert program is called to resize the image.

ImageMagick just says it can't read the file or the file doesn't exist.

Croc Hunter
10-9-09, 03:58 PM
Are folders 755 and files 644? If the plugin needs 777 or 666 to operate don't use it. Is there an option to use GD library instead? ImageMagick is awesome and very powerful if your host allows all it's features. Like most shared hosts Powweb doesn't.

raublekick
10-9-09, 04:02 PM
<edit> It seems to default to GD lib and use ImageMagick if GD lib won't work.

I'm still confused why it worked once but not again.

Croc Hunter
10-9-09, 04:23 PM
Create a test page and try pushing an image up via the standard Flash based uploader.

raublekick
10-9-09, 04:29 PM
I just created a new post and inserted an image using the standard WordPress flash uploader. The image shows up fine but it is not using the other plugin's resizer.

Again, with the other method, uploading is fine, it's calling ImageMagick to resize that is not fine.

Thanks for your help regardless.

raublekick
10-9-09, 05:10 PM
Further inspection reveals that it's really just calling the PHPThumb class, which is deciding on GD or ImageMagick.

raublekick
10-9-09, 05:41 PM
Ok I dug through the plugin code somemore and fixed the issue. However the issue makes further mystery as to why it worked once and not again.

The plugin looks at the DOCUMENT_ROOT, which is getting all the way to my /htdocs directory. I guess then it appends the path of the file to that to pass to phpThumb. But the image path started with /wp_content instead of the path of my subdomain. If this Wordpress install had been in the root of my website, I think it would work.

I made a quick fix and now it's working. I guess the problem was with the plugin afterall...