Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use feature qw(say);
- use strict;
- use warnings;
- use Image::ExifTool;
- my $fn = "2.png";
- my $exif = Image::ExifTool->new();
- my $info = $exif->ImageInfo($fn);
- if (exists $info->{Error}) {
- die "Could not extract meta information from '$fn': $info->{Error}";
- }
- say "Warning: $info->{Warning}" if exists $info->{Warning};
- $exif->SetNewValue(FileCreateDate => '2021:02:27 16:59:18+01:00', Protected => 1);
- my $res = $exif->WriteInfo($fn);
- die "Could not update file '$fn'" if $res == 0;
- say "Updated '$fn'.";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement