[Gambas-user] loading image

Benoît Minisini gambas at ...1...
Sat Oct 17 16:19:39 CEST 2009


> I want to display Thumbnails of JPEGs.
> 
> As Image.Load(Path) and Picture.Load(Path) require a path, right now I do:
> - extract the Thumbnail from JPEG with a SHELL command
> - save it to disk as thumb_nnn.jpg
> - read it again from disk with Image.Load(Path).
> 
> This is a complicated way and takes really long time if there are many
>  JPEGs in a folder.
> 
> So I try to load the output of the SHELL command directly into an Image.
> But then, Gambas says "Wanted Image, got String instead".
> So, the output of the SHELL command comes in as a String.
> What now?
> 
> Any way to convert this String into an Image?
> Anybody any ideas?
> 
> Thanks, Matti
> 

There is no way to do that directly while I have no library to extract a 
thumbnail from a jpeg file.

But you can faster things a bit by :
- Not saving the thumbnail as a jpeg, but by using a non-compressed image 
format.
- Saving the thumbnail in /tmp, provided that /tmp is mounted in ram (tmpfs).

Regards,

-- 
Benoît Minisini




More information about the User mailing list