Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Testing JPEGs for validity (windows)

by dk (Chaplain)
on Jul 13, 2010 at 10:50 UTC ( [id://849229]=note: print w/replies, xml ) Need Help??


in reply to Testing JPEGs for validity (windows)

A really quick and dirty hack would be to test if the first two bytes in file are 0xFF and 0xD8.
  • Comment on Re: Testing JPEGs for validity (windows)

Replies are listed 'Best First'.
Re^2: Testing JPEGs for validity (windows)
by kosmarnik (Acolyte) on Jul 13, 2010 at 14:17 UTC
    Nah, that would just be checking if they're JPEGs. I need to test the integrity, decode the JPEG. That got me thinking, what about using a module like imagemagick or something to try to decode and get the error report if they have it? Got something surefire of the top of your head?
      Well, imagemagick also requires libjpeg, and so does any other tool that goes through full decoding. If I were you, I'd just apply the patch with _setjmp above to the needed tools.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://849229]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-20 11:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found