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 »

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 »

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: 8883
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 »

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 »

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: 8883
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 »

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 »

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: 8883
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 »

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