Click here to get back home

how to simply parse raw image data and output to an image file ?

 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
how to simply parse raw image data and output to an image file ? Jack 01-03-2008
Posted by Jack on January 3, 2008, 11:19 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

Similar ThreadsPosted
best way to store binary image data in a variable using image magick January 25, 2008, 1:17 am
Image data parsing October 27, 2004, 3:36 pm
posting image data (not url) from HTML to Perlscript June 6, 2006, 12:33 pm
save image from url to file - how to? June 21, 2006, 9:49 am
How to get an image file and display it on the screen? October 27, 2004, 6:12 pm
read image file - and process the result December 4, 2004, 4:01 pm
Error in using GD Image July 30, 2005, 1:15 pm
Image::GD::Thumbnail August 16, 2005, 10:01 am
Image Reader December 19, 2006, 12:09 am
delivering image from a script July 18, 2004, 1:49 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap