Unfortunately, Image::Epeg-new(\$jpg_data); isn’t working.What makes you write that? I'm too lazy to whip up a database, but the following code pulls a JPEG image into a scalar and thumbnails it successfully.
Side note: You need to have LWP::Protocol::https installed for this code.use 5.020; use warnings; use Image::Epeg qw(:constants); use LWP::Simple; # Copyright notice for the image: # By Randal Schwartz from Portland, OR, USA - Flickr, CC BY-SA 2.0, # https://commons.wikimedia.org/w/index.php?curid=2938351 my $image = get("https://upload.wikimedia.org/wikipedia/commons/b/b3/L +arry_Wall_YAPC_2007.jpg"); die "Failed to load the image" unless defined $image; my $epeg = Image::Epeg->new(\$image); $epeg->resize(150,150,MAINTAIN_ASPECT_RATIO); $epeg->write_file("thumbnail.jpg");
In reply to Re: Extracting a blob from DBI to a buffer
by haj
in thread Extracting a blob from DBI to a buffer
by Serene Hacker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |