in reply to Testing JPEGs for validity (windows)

And indeed it does not compile on Windows. It dies with errors like TestJPG.xs:47:30: error: macro "PerlProc_setjmp" requires 2 arguments, but only 1 given

Could that be due to a missing library?

Have you tried Image::JpegCheck? The docs are unclear whether it will check if the whole of the jpeg-stream is OK, but you can give it a try with some known good and bad files.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: Testing JPEGs for validity (windows)
by dk (Chaplain) on Jul 13, 2010 at 10:53 UTC
    #if defined(_MSC_VER) or defined(WIN32) #undef setjmp #define setjmp _setjmp #endif
    that helped my code to compile on strawberry 5.12. Not that it's the bullet-proof way, but I'm already using many win32-specific switches, so one more doesn't matter.
      Thanks, that helped.
      Now I have to install it ... and have no clue where to put the resulting files. I tried blindly copying them to perl/lib perl/lib but it won't do.
Re^2: Testing JPEGs for validity (windows)
by kosmarnik (Acolyte) on Jul 13, 2010 at 07:04 UTC

    Image::JpegCheck does what is says: checks if it's a JPEG, no necessarily a valid one.

    I've no clue on how to compile on widows 7 x64. I tried following some guides, made some progress, but could not make it compile :(

    Any other ideas?

      I've no clue on how to compile on widows 7 x64. I tried following some guides, made some progress, but could not make it compile :( Any other ideas?

      Install strawberry perl, it comes with libjpeg

        Install strawberry perl, it comes with libjpeg

        I could try that, but I'd rather learn how to do it properly.