[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

rmagick via parallels

Paul Rogers

2/29/2008 11:13:00 PM

I have some code that Im sure used to work on Vista under parallels,
but now only works on Vista on a PC hardware.

Im using Win32::Screenshot to capture the windows screen, and then
using rmagick to save to a file

I now get this exception
Insufficient image data in file `'
:in `from_blob'

the code looks like this

width, height, bmp = Win32::Screenshot.desktop
puts "image data height = #{height} width = #{width}"
puts "bmp size is #{bmp.size}"
img = Magick::Image.from_blob(bmp)[0]

I see this displayed

Taking screenshotimage data height = 984 width = 1595
bmp size is 4708494


the gem versions are

rmagick (1.15.9)
RMagick is an interface between the Ruby programming language and
the ImageMagick and GraphicsMagick image processing libraries.
win32screenshot (0.0.2)
Capture Screenshots on Windows with Ruby

and are the same on win and win-parallels.
can any one tell me what it means, and how to fix?

Thanks
Paul
1 Answer

emanuel.eklund

4/9/2008 10:36:00 AM

0

On Mar 1, 1:13 am, Paul Rogers <pmr16...@gmail.com> wrote:
> I have some code that Im sure used to work on Vista under parallels,
> but now only works on Vista on a PC hardware.
>
> Im using Win32::Screenshot to capture the windows screen, and then
> using rmagick to save to a file
>
> I now get this exception
> Insufficient image data in file `'
> :in `from_blob'
>
> the code looks like this
>
> width, height, bmp = Win32::Screenshot.desktop
> puts "image data height = #{height} width = #{width}"
> puts "bmp size is #{bmp.size}"
> img = Magick::Image.from_blob(bmp)[0]
>
> I see this displayed
>
> Taking screenshotimage data height = 984 width = 1595
> bmp size is 4708494
>
> the gem versions are
>
> rmagick (1.15.9)
> RMagick is an interface between the Ruby programming language and
> the ImageMagick and GraphicsMagick image processing libraries.
> win32screenshot (0.0.2)
> Capture Screenshots on Windows with Ruby
>
> and are the same on win and win-parallels.
> can any one tell me what it means, and how to fix?
>
> Thanks
> Paul

Hi!

I also have this problem. It seems that it occurs when the image is to
big. When I reduced the window that I wanted to make a snapshot of it
works. Please post here again if you find out how to handle bigger
images.

/Malle