Menu

#622 Histogram produces incorrect color table attribute

v1.0_(example)
closed-fixed
None
5
2020-01-11
2020-01-11
No

The following command works correctly in 1.3.31, crashes in 1.3.32 and produces incorrect output in 1.3.33

gm convert colors.gif histogram:-

Previously the comment field of the generated miff file would contain the color information. For example:
comment={
115: ( 3, 3, 6) #030306
217: ( 0, 0, 20) #000014
262: ( 0, 1, 27) #00011B
45: ( 7, 9, 26) #07091A

In 1.3.33 it has a temporary filename:
comment=@/var/folders/tl/3vd029992cj3m8zj_446n4n80000gn/T/gmZfr7jx

Looking at histogram.c, it looks like it writes a temporary file with the color table and sets the attribute using the filename prefixed w/'@'
FormatString(command,"@%.1024s",filename);
(void) SetImageAttribute(histogram_image,"comment",command);

But it looks like the code that resolves the attribute was removed from TranslateTexEx in magick/utility.c
/
If text starts with '@' then try to replace it with the content of
the file name which follows.
/
if ((text == '@') && IsAccessible(text+1))
{
text=(char
) FileToBlob(text+1,&length,&image->exception);
if (text == (char ) NULL)
return((char
) NULL);
}

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2020-01-11
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2020-01-11
    • status: open --> closed-fixed
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2020-01-11

    This problem is fixed by Mercurial changeset 16209:558eac3f8fbb. Thanks for the report!

     

Log in to post a comment.

MongoDB Logo MongoDB