Skip Menu |

This queue is for tickets about the Image-Size CPAN distribution.

Report information
The Basics
Id: 15994
Status: resolved
Priority: 0/
Queue: Image-Size

People
Owner: Nobody in particular
Requestors: mrj [...] mrj.spb.ru
Cc:
AdminCc:

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



Subject: Incorrect use of Compress::Zlib in CWS (flash 6) size
Just small patch for Image::Size module, flash MX (compressed flash) part. Problem is Compress::Zlib::uncompress wants to read complete compressed block and will return empty result otherwise. For swf file larger than internal function's buffer size it will fail to uncompress buffer and thus unable to determine size. Patch in attachment replaces uncompress with inflate, which is streaming realisation and will inflate part of the buffer it able to. Tested with: Compress::Zlib 1.39 Image::Size 2.992 perl v5.8.0 built for i386-linux-thread-multi
Download patch
application/octet-stream 233b

Message body not shown because it is not plain text.

From: mrj [...] mrj.spb.ru
Attachment -- swf image for testing, should report size 280x140, CWS format
Download 8.swf
application/x-shockwave-flash 14k

Message body not shown because it is not plain text.

From: James Austin
On Mon Nov 21 04:51:19 2005, guest wrote: Show quoted text
> Just small patch for Image::Size module, flash MX (compressed flash) > part. > > Problem is Compress::Zlib::uncompress wants to read complete > compressed block and will return empty result otherwise. For swf > file larger than internal function's buffer size it will fail to > uncompress buffer and thus unable to determine size. Patch in > attachment replaces uncompress with inflate, which is streaming > realisation and will inflate part of the buffer it able to. > > Tested with: > Compress::Zlib 1.39 > Image::Size 2.992 > perl v5.8.0 built for i386-linux-thread-multi
Your patch still seems to fail with some movies, for some reason $header = $d->inflate(substr($header, 8, 1024)); (Using perl v5.8.0 MSWin32-x86-multi-thread, Image::Size 2.992, Compress::Zlib 1.39). Produces an out of range error with some movies, breaking the line into two seems to fix this for some reason. e.g. $header = substr($header, 8, 1024); $header = $d->inflate($header); Such that to fix the bug: Replace: $header = substr($header, 8, 1024); $header = Compress::Zlib::uncompress($header); With: my ($d, $status) = Compress::Zlib::inflateInit(); $header = substr($header, 8, 1024); $header = $d->inflate($header);
Patch applied, the test file integrated into the distribution, and a new test added to t/all.t. This will be delivered in the 3.0 release.