Scan for corrupted jpeg files with jpeginfo

Questions that don't fit in any category below may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.
I'm New!
I'm New!
Posts: 1
Joined: Mon Jun 08, 2009 2:16 pm

Scan for corrupted jpeg files with jpeginfo

Postby ultimalvin » Mon Jun 28, 2010 9:44 pm

Hello there,

I have about 70 thousand pictures on my DS109, mostly jpeg files.

And I have noticed that jpeg files do tend to get corrupted over time. Not because of the DS109 itself, but because of many other factors like poor file operations, crashes during copies, etc... When manipulating files a lot, it happens. Not often, but it happens.
And when it happens, if you are (un)lucky to stumble upon a corrupted file, you get a file that won't open, or part if it shows up as gray, or you get artifacts...
If you know a lot about jpeg compression, it is sometimes possible to rebuild a slightly corrupted file. But more often than not, your only hope is to have another clean copy somewhere.
So I have developed a habit of having backups (DVDs, now Blu-Rays), but even those backups are not eternal. Disks are guaranteed to fail anywhere within the next years, longer if you take good care of them, but they will fail eventually, that's a fact.
So I do "regular" backups, every 6 months or so, and store the archives in a cool, dry, dark place. And cross my fingers too...

The thing is, it would be kind of useless to archive corrupted files instead of first replacing them with clean copies from older archives. But to find which files are corrupted, your only option is often to open each and everyone of them with your preferred application. But going through an ever growing collection of tens of thousands of pictures just to check if they open properly is just asking too much of my patience.

Thankfully, on Linux there's a great tool that checks jpeg files for integrity, called jpeginfo. See there for more details :

And a single line script like

find . \( -iname "*.jpg" -or -iname "*.jpeg" \) -print0 | xargs -0 jpeginfo -cv

and pipe the output in a log file does the job perfectly on my old PC, although it takes the PC forever to scan through the files through my home network.

So I'd like to run this script locally on the DS109, running in the background on request or automatically on a periodical basis, and listing the results in a log file.

Is there a way to do this simply without running as root ? Or is there already a tool that does the same ?
Or do I have to compile jpenginfo ? In which case would anyone be kind enough to tell me how ?

Let me know
I'm New!
I'm New!
Posts: 1
Joined: Fri Dec 28, 2012 2:03 am

Re: Scan for corrupted jpeg files with jpeginfo

Postby anthony.dahanne » Fri Dec 28, 2012 2:10 am

Hello ultimalvin,
I successfully run jpeginfo from my Synology DS 211J (armel arch).
Here are the steps I took :
* install ipkg , this post sums it up well : ... ,_ipkg_etc
* then download the debian sid jpeginfo package (this is important: more recent releases have a dependency on libjpeg.8 which is not provided by the ipkg feed) : ; wget ... _armel.deb
* unpack it : ar x jpeginfo_1.6.0-4_armel.deb
* unpack the archive containing the binary : tar xvzf data.tar.gz
* copy to your diskstation the binary : scp ./usr/bin/jpeginfo root@
* from your synology :

Code: Select all

DiskStation> ./jpeginfo -h
jpeginfo v1.6.0 Copyright (c) Timo Kokkonen, 1995-2002.
Usage: jpeginfo [options] <filenames>

enjoy !

Return to “General Mods”

Who is online

Users browsing this forum: No registered users and 3 guests