![]() |
|
|
|||||||
![]() |
PERL - open()ing strings as filehandles |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Hello all,
I'm trying to use ImageMagick to create a thumbnail from an image (JPEG) that I have as a string returned from an SQL query. Image::Magick->Read() will accept either a filename or an open file handle, so I'm opening the string as and passing it a reference (?) to it. my $immk = Image::Magick->new(); open(FH, "<", \$image); $immk->Read(file => \*FH); close(FH); $immk->Thumbnail(width => THUMBNAIL_WIDTH); open(FH, ">", \$image); $immk->Write(file => \*FH, filename => 'image.jpg'); close(FH); When I'm done, I expect to have the thumbnailed image in $image, but I have NULL! If I try this with real files, everything works fine: my $immk = Image::Magick->new(); $immk->Read('/tmp/01.jpg'); $immk->Thumbnail(width => THUMBNAIL_WIDTH); $immk->Write('/tmp/thumbnailed.jpg'); I really have no clue what I'm doing wrong. Thoughts, anyone? Thanks. J. Sharp |
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Website Not Opening! | mansi online | Hardware | 0 | 05-31-2009 03:07 PM |
| Error opening and uplodaing files containing letters such as ä, ö etc. | Chayanne | Software | 3 | 07-03-2007 06:05 AM |
| File download dialog box is coming while opening the document using Servlet | aarthi | Software | 0 | 04-24-2007 03:20 PM |
| OLYMPIC GAMES ATHENS 2004 Opening Ceremony 2 DVDs, Closing Ceremony 2 DVDs, and EURO 2004 ( 6 DVDs ) , THE MATCHES OF THE GREEK NATIONAL FOOTBALL TEAM, DURING THE PANEUROPEAN FOOTBALL CHAMPIONSHIPS 'EURO 2004' IN THE FOOTBALL STADIUMS IN PORTUGAL, W | Zorba.GR | DVD Video | 0 | 10-29-2004 05:45 PM |
| OLYMPIC GAMES ATHENS 2004 Opening Ceremony 2 DVDs, Closing Ceremony 2 DVDs, | eldorado | DVD Video | 2 | 10-27-2004 01:12 AM |