Giter VIP home page Giter VIP logo

exifree's Introduction

ExiFREE

Small EXIF data eraser.

Total alerts Language grade: C/C++

Software License

About

    Exchangeable Image File Format - EXIF, is a standard that specifies the formats for images,
sound and ancillary tags used by digital cameras and smartphones.
    ExiFree is not a Exif library - it is a standalone C code written
from scratch.

Purpose

To remove (erase) data stored in JPEG files that are part of the EXIF.
Here are some examples of data that can be stored in image files, depending
on the configuration of the camera/smartphone:
    - GPS location data;
    - device model and maker;
    - software details;
    - date and time at the moment the picture was taken and more.

Building

Update test submodule
    git submodule update --init --recursive .

Build the binary
    make

Build and run against the test images imported as git submodule from:
    https://github.com/ianare/exif-samples

    make test

An error-free run will look like:

    $ make test
    rm -f exifree
    rm -rf exif-samples/jpg/gps/wiped_DSCN0010.jpg-bin
    /usr/bin/find exif-samples/jpg/ -name "wiped_*" -exec rm -f {} \;
    /usr/bin/gcc exifree.c fs.c buffer.c hexdump.c -Wall -Werror -o /home/user/exifree/exifree
    cd  exif-samples/jpg && ls *.jpg| while read x ; do /home/user/exifree/exifree -d . -f $x >/dev/null && md5=$(/usr/bin/md5sum wiped_$x |cut -d " " -f1) && match=$(grep $x  /home/user/exifree/test-useres.txt| cut -d " " -f1); if [ $md5 != $match ]; then echo ;	echo "!!!!!!!!!!!!! Fail user test for  exif-samples/jpg/$x :~("; echo; fi; done
    cd  exif-samples/jpg/tests && ls *.jpg| while read x ; do /home/user/exifree/exifree -d . -f $x >/dev/null && md5=$(/usr/bin/md5sum wiped_$x |cut -d " " -f1) && match=$(grep $x  /home/user/exifree/test-useres.txt| cut -d " " -f1); if [ $md5 != $match ]; then echo ;	echo "!!!!!!!!!!!!! Fail user test for  exif-samples/jpg/tests/$x :~("; echo; fi; done
    cd  exif-samples/jpg/mobile && ls *.jpg| while read x ; do /home/user/exifree/exifree -d . -f $x >/dev/null && md5=$(/usr/bin/md5sum wiped_$x |cut -d " " -f1) && match=$(grep $x  /home/user/exifree/test-useres.txt| cut -d " " -f1); if [ $md5 != $match ]; then echo ;	echo "!!!!!!!!!!!!! Fail user test for  exif-samples/jpg/mobile/$x :~("; echo; fi; done
    cd  exif-samples/jpg/gps && ls *.jpg| while read x ; do /home/user/exifree/exifree -d . -f $x >/dev/null && md5=$(/usr/bin/md5sum wiped_$x |cut -d " " -f1) && match=$(grep $x  /home/user/exifree/test-useres.txt| cut -d " " -f1); if [ $md5 != $match ]; then echo ;	echo "!!!!!!!!!!!!! Fail user test for  exif-samples/jpg/gps/$x :~("; echo; fi; done
    cd  exif-samples/jpg/hdr && ls *.jpg| while read x ; do /home/user/exifree/exifree -d . -f $x >/dev/null && md5=$(/usr/bin/md5sum wiped_$x |cut -d " " -f1) && match=$(grep $x  /home/user/exifree/test-useres.txt| cut -d " " -f1); if [ $md5 != $match ]; then echo ;	echo "!!!!!!!!!!!!! Fail user test for  exif-samples/jpg/hdr/$x :~("; echo; fi; done
    cd  exif-samples/jpg/gps && /home/user/exifree/exifree -f DSCN0010.jpg -s -d . >/dev/null && cd - && hexdump -C  exif-samples/jpg/gps/wiped_DSCN0010.jpg-bin/* >  exif-samples/jpg/gps/wiped_DSCN0010.jpg-bin/wiped_diff.diff && diff /home/user/exifree/md5-01-sct.txt  exif-samples/jpg/gps/wiped_DSCN0010.jpg-bin/wiped_diff.diff ; if [ $? != 0 ]; then echo ;	echo "!!!!!!!!!!!!! Fail hex test for  exif-samples/jpg/gps/wiped_DSCN0010.jpg-bin files :~("; echo; fi;
    /home/user/exifree

Usage

$ ./exifree -h
Usage: exifree [OPTION]... <FILE>

Optional arguments
 -f <jpeg file>
 -d <dirname>   output directory
 -v             verbose dump sections
 -r             dry-run
 -s             save exif sections in dirname
 -h             show this help
Parameter Description
<image file> Wipe out exif contents & save the output as wiped_<image file>
-r Dry-run against image file - sanity test without generating an output
-v Verbose show sections details to standard output
-s Save sections in output wiped_<image file>-bin
-d <destination directory> Save output file (and sections if used) in destination directory
-h Show help and exit

Sample output

Running with -v (long output, showing here begin-end only)

Screenshot Screenshot

Running with -s

Screenshot Screenshot Screenshot

A glimpse of before and after

Screenshot

References

https://www.awaresystems.be/imaging/tiff/tifftags.html
http://exif.org

Bugs

Currently working on find & name them but surely
there are some or many.

Improvements needed

Support more image formats
Support more image tags
Implement fuzzer module

exifree's People

Contributors

carloslack avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.