|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-10-07 10:52 UTC] rainer-phpbugs at 7val dot com
Description: ------------ The "convert" program supplied with ImageMagick complains when converting the (defective) image located at http://canavan.de/imbugs/pages.gif with the message convert: InvalidColormapIndex `/tmp/pages.gif' @ error/colormap-private.h/ConstrainColormapIndex/34. and generates an output image without transparency. imagick also generates an output image without transparency, but, as far as I can tell, no error is flagged. Test script: --------------- <?php $imagick = new \Imagick(); if ($imagick->readImage($_SERVER['argv'][1])) { print($imagick->getImageBlob()); } else { fprintf(STDERR, "error!\n"); throw new Exception(); } Expected result: ---------------- The error Message generated by libMagickWand/Core should be detectable and retrievable. Actual result: -------------- No detectable error (message) in imagick. I have filed a bug report for this specific image's problem with imagemagick at http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=30608 however, any and all possible errors should be detectable. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 09 12:00:02 2025 UTC |
I'm not sure it's going to be possible to do anything in PHP. There is no error reported from the C api to ImageMagick with the test program below. If there's no error reported, there's no steps we can take. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <malloc.h> #include <wand/MagickWand.h> int main(int argc,char **argv) { MagickWand *magick_wand; MagickBooleanType status; char *exception_text; ExceptionType severity; MagickWandGenesis(); magick_wand = NewMagickWand(); status = MagickReadImage(magick_wand, "./images/pages_invalid_gif.gif"); if (status == MagickFalse) { printf("Failed to MagickReadImage"); return -1; } exception_text = MagickGetException(magick_wand, &severity); if (exception_text == NULL) { printf("exception_text is NULL\n"); } else { printf("exception_text is %s\n", exception_text); } printf("Severity is %d\n", severity); MagickSetImageFormat(magick_wand, "png"); status = MagickWriteImages(magick_wand, "./73263.png", MagickTrue); if (status == MagickFalse) { printf("Failed to MagickWriteImages"); return -1; } MagickWandTerminus(); return(0); }