Problem with removing Exif Data

Started by bigunde, December 30, 2016, 06:23:16 PM

Previous topic - Next topic

bigunde

Hi, thank you so much for this library.

Your library used to remove exif datas before. but anymore it does not remove. Google page speed tool always warn me about it. I am using v10.37 and my code is below. Can you tell me that I am making a mistake or not please?

Quote
#!/usr/bin/perl
my $rc = eval
{
  require Image::ExifTool;
  Image::ExifTool->import();
  1;
};

if($rc){
   my $exifTool = new Image::ExifTool;
   $exifTool->SetNewValue('*');
   $exifTool->WriteInfo("{path}");

   $errorMessage = $exifTool->GetValue('Error');
   $warningMessage = $exifTool->GetValue('Warning');


   if(length($errorMessage)){
      printf "%s", $errorMessage;
   }else{
      if(length($warningMessage)){
         printf "%s", $warningMessage;
      }else{
         printf "SUCCESS";
      }
   }
}else{
   printf "Image::ExifTool does not exist";
}

Phil Harvey

Your script works for me as long as I set {path} correctly.  Could you be more specific about what happens?  .

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).


Hayo Baan

I had a look at the reports you mentioned, the complaint is NOT about exif data at all, it is about the compression of the images. This is something you can not change with exiftool (it never touches the image data).
Hayo Baan – Photography
Web: www.hayobaan.nl

bigunde

I have added the following command and the problem has been fixed.

system("optipng {path}");

Hayo Baan

Quote from: bigunde on December 31, 2016, 06:47:24 AM
I have added the following command and the problem has been fixed.

system("optipng {path}");

Nice! You made have a look at optipng and I might want to start using it myself :)
Hayo Baan – Photography
Web: www.hayobaan.nl