Subject: | Found/Fixed an issue with Image::MetaData::JPEG |
Date: | Sun, 29 Jul 2012 19:17:35 -0700 |
To: | bug-Image-MetaData-JPEG [...] rt.cpan.org |
From: | Ken Greenebaum <keng [...] apple.com> |
I am running Perl v5.12.4 on a Mac running OS X 10.8 and encountered an issue with Image::MetaData::JPEG where even in the most simple re-write case a spurious 0x20 is inserted after every marker written causing the resulting jpeg file to be corrupt.
The issue might not be in the library, but in my perl program hosting the library however the library should ideally be robust to this.
Simple example:
my $image = new Image::MetaData::JPEG('source.jpg', $parseSegments);
$image->save('rewrite.jpg');
I found that replacing the comma enumeration with a period concatenation in the return from the module's Segment.pm:output_segment_data() fixed the issue for me:
return print {$out} $preamble.$this->data(0, $length);
I hope this can help someone else.
-Ken