Efficiently detect corrupted jpeg file?

Posted by Jacco on Stack Overflow See other posts from Stack Overflow or by Jacco
Published on 2008-10-13T17:56:30Z Indexed on 2010/05/03 20:38 UTC
Read the original article Hit count: 335

Filed under:
|
|

Is there an efficient way of detecting if a jpeg file is corrupted?

Background info:
  solutions needs to work from within a php script
  the jpeg files are on disk
  manual checking is no option (user uploaded data)

I know that imagecreatefromjpeg(string $filename); can do it. But it is quite slow at doing so.

Does anybody know a faster/more efficient solutions?

© Stack Overflow or respective owner

Related posts about php

Related posts about Corruption

  • help! corrupt file recovery

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    My supervisor computer crashed last night, and I'm trying to help him out. He made an R script but when he tried to open it, it was empty. But for some reason the file is 7.9kb so it should not be empty i think... anyway when i tried to open it, Gedit gave this error: "The file you opened has… >>> More

  • Login screen restarts while entering password

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I am having a problem that only occurred after installing the fglrx proprietary driver through the additional drivers app. The exact same issue is described in this question, however it's closed. Must login twice before entering Unity; first login screen has graphical anomalies When I boot up my… >>> More

  • Delete corrupted folder

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I am trying to delete a folder in my home directory; its name is completely garbled. In Nautilus, the garbled text is followed by 'Invalid Directory.' Deleting it with Nautilus stalls; I can't type in the garbled name in the terminal. peter@io_vbox:~$ ls -lbdR * ... drwxrwxr-x 3 peter peter … >>> More

  • Error while installing netbeans

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I tried to install NetBeans 7.2 from a downloaded .sh file, but experienced problems. Here's text from the Terminal, which shows what I did and what happened: hridesh@ubuntu:~$ cd Desktop/ hridesh@ubuntu:~/Desktop$ cd full\ netbeans\ 7.2\ for\ linux\ in\ .sh\ format/ hridesh@ubuntu:~/Desktop/full… >>> More

  • How do I fix a corrupted harddrive after failed upgrade?

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    The problem originated when I was trying to fix this problem. Things went horribly, horribly wrong and I ended up with a new problem altogether. The last thing I did was run sudo apt-get install and that caused my system to freeze. I restarted my computer and it would not boot from the harddrive… >>> More