Page 1 of 1

How to create a thumbnail using ImageToBlob/BlobToImage ?

Posted: 2012-05-16T02:52:03-07:00
by lauchuen
hi,

my idea is storing a picture into database, then before update trigger a procedure to create thumbnail itself.
is that possible to do this with PerlMagick ? thanks.

Re: How to create a thumbnail using ImageToBlob/BlobToImage

Posted: 2012-05-17T23:27:12-07:00
by lauchuen
any idea how to store ImageToBlob in database?

since i've try its not work,

Code: Select all

$_TP{new}{thumbnail} = $image->ImageToBlob();
anyone can give me some hints ? or actually its won't work? thanks a lot.

Re: How to create a thumbnail using ImageToBlob/BlobToImage

Posted: 2012-05-21T19:12:14-07:00
by anthony
From my understanding that should work fine, though you may need to set the 'Magick' of the image to select the right image file format other wise it will default to the meta-data saved format of the image read.

Re: How to create a thumbnail using ImageToBlob/BlobToImage

Posted: 2012-05-22T04:06:59-07:00
by lauchuen
thanks you for your reply.

could you show me some sample code or any document/example about database ImageToBlod/BlobToImage ? because i'm really new in perlmagick, thanks a lot.

Re: How to create a thumbnail using ImageToBlob/BlobToImage

Posted: 2012-05-22T20:44:27-07:00
by anthony
I have not used it much myself.

An example I believe is on the PerlMagick Web Page
http://imagemagick.org/script/perl-magick.php#blobs

before writing the blobs you should set all the images "magick" attribute to the format wanted.

Re: How to create a thumbnail using ImageToBlob/BlobToImage

Posted: 2012-05-23T00:20:23-07:00
by lauchuen
thanks your reply, i read the example before, since there're lag of information about database usage.

yes, already define the image "magick" but still fail. please help. thanks a lot.

Re: How to create a thumbnail using ImageToBlob/BlobToImage

Posted: 2012-05-27T23:35:37-07:00
by anthony
Try using a 'magick' coder of TXT with a small image, then print the result.