Create PHP function to strip all metadata from ALL image types

  • Status: Closed
  • Prize: $15
  • Entries Received: 1
  • Winner: Svetoslav92

Contest Brief

I need a PHP function that will work in PHP 5.3. It must strip all metadata information from all types of images (jpg, png, gif, bmp, etc.) and then save the new stripped file into a specified location (ie: imageStrip($oldFileLocation,$newFileLocation);) It must work on iPage hosting (jpegtran, imagemagick are possibilities for accomplishing this) and not require the use of any third party PHP extensions or cause any loss of image quality.

Recommended Skills

Public Clarification Board

  • grubby6913
    Contest Holder
    • 11 years ago

    im gonna wait a few days and see if anything else comes up, if not then I will gladly give you the payment for this project. Thanks a ton and good work..

    • 11 years ago
  • Svetoslav92
    Svetoslav92
    • 11 years ago

    So yeah with this function you can remove the exifs from png,gif,jpeg,jpg .. As I see your hosting has GD library so it will work. BMP doesn't have metadata so it also falls off from the list. That's pretty much PHP can offer since these 4 filetypes are the major in browsers and as you probably know PHP is made mostly for that. If you need removing the exif info from another files like tiff,jp2 or any other much rare files then you'll need some software doing this.If this software has batch scripting maybe PHP can call it with the appropriate commands but I guess this is way too complicated and only if really necessary.
    I hope this helps.
    Thanks

    • 11 years ago
  • Svetoslav92
    Svetoslav92
    • 11 years ago

    The functions imagejpeg (works for both jpeg and jpg files),imagepng and imagegif are for that case (as I've used them in the example).

    • 11 years ago
  • Svetoslav92
    Svetoslav92
    • 11 years ago

    Well it is all about in loading the image to the GD and storing it again to another place (or overwriting..) with no exif information.

    • 11 years ago
  • grubby6913
    Contest Holder
    • 11 years ago

    Thanks for the good an quick suggestion. I may end up using that in the long wrong and just alter to it better suit what I need..

    • 11 years ago
  • grubby6913
    Contest Holder
    • 11 years ago

    i could have done that...is there any way to be able to except ALL photos/image files? what if the extension is .jpeg or something of that nature. I have a function that detects if it is an image file ( exif_imagetype($file) ) and continues on with stripping. this will detect any file with any extension as long as its an image file but only is able to strip from .jpeg/.jpg files.

    • 11 years ago
  • Svetoslav92
    Svetoslav92
    • 11 years ago

    It is simple and pretty straight forward. I am going to do it quick.
    Thanks

    • 11 years ago

Show more comments

How to get started with contests

  • Post your contest

    Post Your Contest Quick and easy

  • Get tons of entries

    Get Tons of Entries From around the world

  • Award the best entry

    Award the best entry Download the files - Easy!

Post a Contest Now or Join us Today!