First, let me prefaace by saying I expect that this is largely an eror with Image API and is in their issue queue (http://drupal.org/node/375062); however, at least for me, it only occurrs when I apply an imagecache preset to images imported into the default "News Item" content type.

*Note* Had the issue been even acknowledged on the Image API issue queue, I wouldn't even have considered posting it here.

If I apply an imagecache setting to resize the image when viewing the full node via 'read more' or by viewing the 'news item' content type article directly, I get the following error in admin panel:

warning: imagecolorsforindex() [function.imagecolorsforindex]: Color index 255 out of range in /sites/all/modules/imageapi/imageapi_gd.module on line 251.

If I remove the imagecache preset, the node goes away; however, then the image is back to full size, which in my particular situation, isn't optimal for the page.

I fully understand if this is not an issue you can assist with as the error call comes from Image API; however, you have been so helpful with every issue I have read for this module, I thought you may have some insight on the problem :)

This is not regarding the module using the imagecache presets as can be chosen within block configuration, only with the full node view.

One possible solution offered in http://drupal.org/node/375062#comment-2193242 (Comment #6) was:

I was using imagecache to display images from a view, but it turns out those images didn't exist in my local files directory. When I pulled them in, the error disappeared, so not sure if this is a bug or not.

This sounds like it may be the case with "News Item" when viewing the full node; so how would I go about fixing this? Any ideas?

Comments

ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

When I look at the code in the image api module, line 251, is only used for "gif" images.

I see at your site that the following image is a gif image: http://www.thenewvilla.villacollectionsdesign.com/sites/default/files/im...

Workaround could be to convert this image to png or jpg

Hope this helps you further, please let me know

EDIT: See now that this image is not used in the slideshow, so maybe it does not help you further.

bstrange’s picture

Wow, you are good :) Yes, that's it exactly! The site you found that gif on is the old sandbox from before I put it into production, and that .gif is still running on the live site, easy fix!

Thanks so much!

If you don't mind, I am going to repost your answer on the Image API issue queue thread I linked and maybe it will help out the people over there as well, unless you would like to post that solution yourself. I will of course, give you the proper credit :)

(They've gone over a year on that issue without anything resembling a solution, so I'm sure your tip would be greatly appreciated :)

Thanks again!

ppblaauw’s picture

Title: Getting Image API error when applying Imagecache preset to News Item Node » Getting Image API error when applying Imagecache preset to News Item Node (Workaround)
Status: Postponed (maintainer needs more info) » Fixed

Sure, just post this workaround in the other thread. It's not really a solution when you want to use gif images (the issue can still happen when using gif images), but at least users will have another option which can be useful.

Set status here to fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.