How to create a thumbnail using ImageToBlob/BlobToImage ?

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
lauchuen
Posts: 4
Joined: 2012-05-16T02:44:33-07:00
Authentication code: 13

How to create a thumbnail using ImageToBlob/BlobToImage ?

Post by lauchuen » 2012-05-16T02:52:03-07:00

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.

lauchuen
Posts: 4
Joined: 2012-05-16T02:44:33-07:00
Authentication code: 13

Re: How to create a thumbnail using ImageToBlob/BlobToImage

Post by lauchuen » 2012-05-17T23:27:12-07:00

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.

User avatar
anthony
Posts: 8882
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to create a thumbnail using ImageToBlob/BlobToImage

Post by anthony » 2012-05-21T19:12:14-07:00

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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

lauchuen
Posts: 4
Joined: 2012-05-16T02:44:33-07:00
Authentication code: 13

Re: How to create a thumbnail using ImageToBlob/BlobToImage

Post by lauchuen » 2012-05-22T04:06:59-07:00

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.

User avatar
anthony
Posts: 8882
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to create a thumbnail using ImageToBlob/BlobToImage

Post by anthony » 2012-05-22T20:44:27-07:00

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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

lauchuen
Posts: 4
Joined: 2012-05-16T02:44:33-07:00
Authentication code: 13

Re: How to create a thumbnail using ImageToBlob/BlobToImage

Post by lauchuen » 2012-05-23T00:20:23-07:00

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.

User avatar
anthony
Posts: 8882
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to create a thumbnail using ImageToBlob/BlobToImage

Post by anthony » 2012-05-27T23:35:37-07:00

Try using a 'magick' coder of TXT with a small image, then print the result.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Post Reply