Hacker News new | ask | show | jobs
by ValentineC 4777 days ago
Flickr aside, I am surprised nobody (AFAIK) has come up with a way of sanitizing uploaded image files yet.

I wonder if there's a way for GD/ImageMagick to detect the image data and strip everything else. (And if EXIF data is needed for photographs, import all non-binary EXIF data into the system first.)

4 comments

Many do, but it isn't always "sanitizing". http://www.iptc.org//site/Home/Media_Releases/IPTC_study_sho...:

"According to a study by the International Press Telecommunications Council (IPTC), major social networks like Facebook, Twitter or Flickr remove copyright information and other useful embedded data from pictures posted by their users"

Imgur does this.

It also compresses big files though so I'm not sure if it can do it without effecting the image data and format itself.

mogrify -strip imagename.jpg

But it won't help. You could just make your data a real image.

You might as well change a single byte. A tiny modification and BANG! nobody notices and the service is pretty useless as a general back-up solution.

They could even implement that in their TOS: "whenever you upload a photo you agree to a random byte being modified on one of the pixels on the border."

It would be pretty easy to stick in some redundancy
Decompress and subsequent recompress would do this just fine.
What would do what fine? mogrify -strip removes what he asks...
Doesn't Facebook already do this?