Sat Aug 06 23:51:53 2011: Request 70112 was acted upon.
Transaction: Ticket created by Vitantonio
       Queue: Win32-Clipboard
     Subject: GetBitmap returns partial bitmap
   Broken in: 0.56
    Severity: Important
       Owner: Nobody
  Requestors: beau.e....@gmail.com
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=70112 >


Method GetBitmap does not return the entire image - it seems only the 
bitmap header (along with the file header generated by the module) is 
returned. Further investigation shows that the field 
miHeader.biSizeImage is zero in the data returned my the system call 
GetClipboardData. The attached patch replaces the field with GlobalSize
(handle returned by system call) if it is zero. Works for me...

perl -v
This is perl 5, version 12, subversion 3 (v5.12.3) built for MSWin32-
x64-multi-thread
(with 9 registered patches, see perl -V for more detail)

Copyright 1987-2010, Larry Wall

Binary build 1204 [294330] provided by ActiveState 
http://www.ActiveState.com
Built Feb  9 2011 14:23:34

Perl may be copied only under the terms of either the Artistic License 
or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to 
the
Internet, point your browser at http://www.perl.org/, the Perl Home 
Page.

Windows 7 Ultimate 64 bit.

Aloha, Vitantonio.
--- Win32-Clipboard-0.56/Clipboard.xs   2011-01-13 15:59:22.000000000 -1000
+++ Win32-Clipboard-0.56-modified/Clipboard.xs  2011-08-06 04:08:47.985559800 
-1000
@@ -367,6 +367,8 @@
        rgbquad_array_length = clrUsed;
     dib_offset = bmi->bmiHeader.biSize + mask_bytes +
        rgbquad_array_length * sizeof(RGBQUAD);
+    if( bmi->bmiHeader.biSizeImage == 0 )
+        bmi->bmiHeader.biSizeImage = GlobalSize( h );
     dib_size = dib_offset + bmi->bmiHeader.biSizeImage;
     p_hdr->bfType = 0x4d42;        /* 0x42 = "B" 0x4d = "M" */
     p_hdr->bfSize = (DWORD) (sizeof(BITMAPFILEHEADER) + dib_size);

Reply via email to