Sabtu, 08 Oktober 2016

Bristol Digest, Vol 664, Issue 8

Send Bristol mailing list submissions to
bristol@mailman.lug.org.uk

To subscribe or unsubscribe via the World Wide Web, visit
https://mailman.lug.org.uk/mailman/listinfo/bristol
or, via email, send a message with subject or body 'help' to
bristol-request@mailman.lug.org.uk

You can reach the person managing the list at
bristol-owner@mailman.lug.org.uk

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Bristol digest..."


Today's Topics:

1. Re: Bulk Exif date insertion - Perl error (nick robinson)


----------------------------------------------------------------------

Message: 1
Date: Fri, 7 Oct 2016 15:37:03 +0100
From: nick robinson <nick@njrobinson.net>
To: Peter Hemmings <peternsomerset@virginmedia.com>, Bristol and Bath
Linux User Group <bristol@mailman.lug.org.uk>
Subject: Re: [bristol] Bulk Exif date insertion - Perl error
Message-ID:
<CADo8qK7Fc1mRcxw1WzheJkbhwjSsvJOwwsVnVC_FZxz1Jhc0Tw@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Just a note here with the system command you are supposed to pass your
parameters to the command i.e.

system("exiv2","param1","param2")

rather use backticks if you want to keep this notation

On 6 October 2016 at 11:21, Peter Hemmings via Bristol <
bristol@mailman.lug.org.uk> wrote:

> Hi,
>
> I have started to scan old transparencies onto my PC and have bulk renamed
> them OK with "Thunar" file manager.
> Before I import them I want to insert exif dates on groups of images.
>
> I have been trying exiv2 with a perl script to bulk insert. It does seem
> to work but throws up errors as the originator expected but I am curious to
> know where the problem is and if I can eliminate it!
>
> I know very little about perl but can get the idea of what the script does.
>
> Can anyone enlighten me as to if the problem is with exiv2 or the script
> and how I could make it work better?
>
> References:
>
> Actual Script:
>
> #!/usr/bin/perl -w
> #
> # ADDING DATES TO SCANNED PHOTOS OR NEGATIVES
> #
> # Kim Briggs 2009-12 http://kimbriggs.com
> #
> # Script uses the exiv2 program http://www.exiv2.org/
> # to add EXIF date and metadata to JPGS (and rename with new timestamp).
> #
> # Process ONE ROLL of film at a time (59 pics max).
> # Numbering sequence is from NOON, i.e., 120100 to 125900.
> #
> # Reference of EXIF format: Date Taken: 2009:10:07 15:24:02
> # ModifyDate=DateTime(EXIFspec)
> # CreateDate=DateTimeDigitized(EXIFspec)
> # DateTimeOriginal(ExifIFD)
> # exiv2 -pt = print all the exif tags to screen
> #
>
> print "Enter Your Name: ";
> chomp($my_name = <>);
>
> print "Enter the Year(YYYY): ";
> chomp($my_year = <>);
>
> print "Enter the Month(MM): ";
> chomp($my_month = <>);
>
> print "Enter the Day(DD): ";
> chomp($my_day = <>);
>
> # Load all jpgs into an array. Use the same suffix for all files to
> preserve your order.
> # There will be an error message about the suffix you didn't use. Ignore
> it.
> @pix = `ls *.JPG *.jpg`;
>
> $my_count = 0;
>
> foreach $pix (@pix) {
>
> if ($my_count < 10) {$my_count="0$my_count";}
>
> print "Processing photo: ".$pix;
> # Use the program exiv2 to process EXIF metadata and rename the file with
> timestamp
>
> system("exiv2 -M'set Exif.Image.Artist $my_name $my_website' $pix");
>
> system("exiv2 -M'set Exif.Image.Copyright Copyright $my_year $my_name. All
> Rights Reserved.' $pix");
>
> system("exiv2 -M'set Exif.Image.DateTime $my_year:$my_month:$my_day
> 12:$my_count:00' $pix");
>
> system("exiv2 -M'set Exif.Photo.DateTimeOriginal
> $my_year:$my_month:$my_day 12:$my_count:00' $pix");
>
> system("exiv2 -M'set Exif.Photo.DateTimeDigitized
> $my_year:$my_month:$my_day 12:$my_count:00' $pix");
>
> # Comment out the line below with a "#" symbol to AVOID RENAMING the file.
>
> system("exiv2 -r %Y_%m%d_%H%M%S $pix");
>
> $my_count = int($my_count) + 1;
> }
>
>
> http://www.exiv2.org/
> http://kimbriggs.com/computer/add-exif-date-scanned-photo-negative
>
> FYI when its run, it first complains about "website'$pix" only occurring
> once, then asks for name etc. then actuall runs and does the job OK.
>
> So another question is where does it get "my_website $pix"!?
>
>
>
> Thanks
> --
> Peter H
>
> _______________________________________________
> Bristol mailing list
> Bristol@mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/bristol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.lug.org.uk/mailman/private/bristol/attachments/20161007/6a88266d/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Bristol mailing list
Bristol@mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/bristol

------------------------------

End of Bristol Digest, Vol 664, Issue 8
***************************************

Tidak ada komentar:

Posting Komentar