ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: bigunde on December 30, 2016, 06:23:16 PM

Title: Problem with removing Exif Data
Post by: bigunde on December 30, 2016, 06:23:16 PM
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";
}
Title: Re: Problem with removing Exif Data
Post by: Phil Harvey on December 30, 2016, 10:33:34 PM
Your script works for me as long as I set {path} correctly.  Could you be more specific about what happens?  .

- Phil
Title: Re: Problem with removing Exif Data
Post by: bigunde on December 31, 2016, 05:33:19 AM
Yes, it works but google page speed tools and gtmetrix warn me about it.

https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fberkatan.com%2Fxxxx&tab=desktop

https://gtmetrix.com/reports/berkatan.com/dIeHNmIv

what should I do?
Title: Re: Problem with removing Exif Data
Post by: Hayo Baan on December 31, 2016, 05:50:58 AM
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).
Title: Re: Problem with removing Exif Data
Post by: bigunde on December 31, 2016, 06:47:24 AM
I have added the following command and the problem has been fixed.

system("optipng {path}");
Title: Re: Problem with removing Exif Data
Post by: Hayo Baan on December 31, 2016, 01:18:49 PM
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 :)