Click here to get back home

Is it possible to resize or crop JPG image with Perl?

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Is it possible to resize or crop JPG image with Perl? max 08-31-2005
Posted by max on August 31, 2005, 8:44 am
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Posted by Simon Taylor on August 31, 2005, 5:26 pm
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Similar ThreadsPosted
Perl Script to Resize Images .jpgs (and .gifs too) December 12, 2005, 8:40 am
Win32:OLE How to size or resize Excel comment textfield? February 22, 2005, 10:34 am
how to simply parse raw image data and output to an image file ? January 3, 2008, 11:19 am
best way to store binary image data in a variable using image magick January 25, 2008, 1:17 am
Image processing in perl? September 13, 2007, 11:03 pm
perl PNG image searching May 6, 2008, 2:02 pm
Perl grabbing an external image December 15, 2005, 2:36 pm
perl GD Image resolution problem May 5, 2008, 11:28 pm
Image::Magick and perl script STDOUT problem July 20, 2005, 10:05 am
Good documentation or good source examples for Image::Magick or converter from commandline to perl April 1, 2008, 5:23 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap