Skip Menu |

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 67912
Status: resolved
Priority: 0/
Queue: Imager

People
Owner: Nobody in particular
Requestors: TONYC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 0.84



Subject: make_colors => "none" and write() to gif still seems to make some colors
Date: Tue, 3 May 2011 11:27:01 +1000
To: bug-Imager [...] rt.cpan.org
From: tonyc [...] cpan.org
Documented or not, it's confusing (below). Perhaps something left from the lmext stuff. perl -MImager -e '$im = Imager->new(file => shift) or die; $im->write(file => "foo.gif", make_colors => "none", colors => [ map Imager::Color->new($_), qw/#000 #111 #222 #333 #444 #555 #666 #777 #888 #999 #AAA #bbb #ccc #ddd #eee #fff/ ]) or die "write";' /home/tony/play/plan-1304377492_plan-vt-032.png.gif Dump: tony@mars:.../git/bse-ui$ imager --palette foo.gif foo.gif 0: ( 0, 0, 0) 1: ( 17, 17, 17) 2: ( 34, 34, 34) 3: ( 51, 51, 51) 4: ( 68, 68, 68) 5: ( 85, 85, 85) 6: (102, 102, 102) 7: (119, 119, 119) 8: (136, 136, 136) 9: (153, 153, 153) 10: (170, 170, 170) 11: (187, 187, 187) 12: (204, 204, 204) 13: (221, 221, 221) 14: (238, 238, 238) 15: (255, 255, 255) 16: ( 8, 8, 8) 17: ( 16, 16, 16) 18: ( 24, 24, 24) 19: ( 32, 32, 32) 20: ( 41, 41, 41) 21: ( 49, 49, 49) 22: ( 57, 57, 57) 23: ( 65, 65, 65) 24: ( 74, 74, 74) 25: ( 82, 82, 82) 26: ( 90, 90, 90) 27: ( 98, 98, 98) 28: (106, 106, 106) 29: (115, 115, 115) 30: (123, 123, 123) 31: (131, 131, 131) 32: (139, 139, 139) 33: (148, 148, 148) 34: (156, 156, 156) 35: (164, 164, 164) 36: (172, 172, 172) 37: (180, 180, 180) 38: (189, 189, 189) 39: (197, 197, 197) 40: (205, 205, 205) 41: (213, 213, 213) 42: (222, 222, 222) 43: (230, 230, 230) 44: (246, 246, 246) 45: ( 0, 0, 0) 46: ( 0, 0, 0) 47: ( 0, 0, 0) 48: ( 0, 0, 0) 49: ( 0, 0, 0) 50: ( 0, 0, 0) 51: ( 0, 0, 0) 52: ( 0, 0, 0) 53: ( 0, 0, 0) 54: ( 0, 0, 0) 55: ( 0, 0, 0) 56: ( 0, 0, 0) 57: ( 0, 0, 0) 58: ( 0, 0, 0) 59: ( 0, 0, 0) 60: ( 0, 0, 0) 61: ( 0, 0, 0) 62: ( 0, 0, 0) 63: ( 0, 0, 0) tony@mars:.../git/bse-ui$ perl -MImager -e '$im = Imager->new(file => shift) or die; $im->write(file => "foo.gif", make_colors => "none", colors => [ map Imager::Color->new($_), qw/#000 #111 #222 #333 #444 #555 #666 #777 #888 #999 #AAA #bbb #ccc #ddd #eee #fff/ ], max_colors => 16) or die "write";' /home/tony/play/plan-1304377492_plan-vt-032.png.gif tony@mars:.../git/bse-ui$ imager --palette foo.gif foo.gif 0: ( 0, 0, 0) 1: ( 17, 17, 17) 2: ( 34, 34, 34) 3: ( 51, 51, 51) 4: ( 68, 68, 68) 5: ( 85, 85, 85) 6: (102, 102, 102) 7: (119, 119, 119) 8: (136, 136, 136) 9: (153, 153, 153) 10: (170, 170, 170) 11: (187, 187, 187) 12: (204, 204, 204) 13: (221, 221, 221) 14: (238, 238, 238) 15: (255, 255, 255)
The problem is Imager's behaviour when the original image is paletted. The GIF handling code will use the image's palette rather than using the user specifified palette.
Fixed in 0.84