If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Is there a way to COPY EXIF information from one JPG to anotherin Linux?
Tourgueniev wrote:
On Wed, 15 Oct 2014 01:23:33 +0000, Parko wrote: You could also try exiv2. Command line tool, so it may not suit you if you're all gooey like any other creative type. Check your distro's repos if its not installed by default. I'm doing ok, so far, with the first suggestion, which was exiftool. At the moment, it moved all the exif tags from one photo to the next, but the problem now are the 4 problematic tags: File Size : 100 kB Exif Image Width : 480 Exif Image Height : 640 Image Size : 480x640 As you saw, in a previous post, easy to take care of... :-) Googling for how to change exif data on linux, I found these examples: http://dimitar.me/change-the-date-an...s-with-ubuntu/ This resets the dates to whatever you want them to be: exiftool -AllDates='2014:10:10 15:35:33' -overwrite_original new.jpg Testing that syntax with the 4 obvious exif tags above, I tried this: $ ls -l new.jpg -rw-rw-r-- 1 root root 67160 Oct 14 23:40 new.jpg exiftool -File Size='67160' -overwrite_original new.jpg But I apparently need to work on the syntax a little bit. If that would work, it would be, with no spaces in the tag name. exiftool -filesize='67160' new.jpg Arguments are not case sensitive, but of course cannot have whitespace. Use the -s option(s) to see unambiguous tag names with no whitespace. But the file size is not a tag (use the -G option to see tag groups), it's just telling you what the actual file size is, and you can't change that with exiftool. The same happens with the image pixel dimensions, which will always be determined empirically. An example of a tougher problem is keeping the Orientation tag correct. If you rotate an image in an editor and write it out, the tag may still be for the original image and will not be correct. There may be other values that work, but I'm sure of these: -orientation="rotate 90 cw" -orientation="rotate 90" -orientation="rotate 180" -orientation="rotate 270 cw" -orientation="rotate 270" -orientation="normal" -orientation="horizontal" -orientation="horizontal (normal)" Of course there is no way for a program to determine if it is actually horizontal or a 180 degree rotation, and the same with 90 and 270. Since the image pixel dimensions are determined from the file itself, not from a tag, it is always safe to use those to calculate what the orientation flag should be. Here's test script that shows some ways around a couple pitfalls. ------ start of script ------ #/bin/bash file="new.jpg" height="$(exiftool -s -s -imageheight ${file} | cut -d' ' -f2)" width="$( exiftool -s -s -imagewidth ${file} | cut -d ' ' -f2)" echo "${width} W x ${height} H" tagorient="horizontal" # default # # Send stderr to /dev/null to avoid seeing thr error if values are not digits # # ${result} will be: # 0 landscape oriented image # 1 portrait oriented image # 2 invalid arguments, not digits # test "${height}" -gt "${width}" 2/dev/null; result="${?}" if [ "${result}" -eq 0 ] ; then tagorient="rotate 90" fi if [ "${result}" -gt 1 ] ; then echo "Either height (${height}) or (${width}) is invalid." exit 1 fi exiftool -orientation="${tagorient}" "${file}" echo "orientation tag will be: $tagorient" exiftool -orientation "${file}" echo "Exit status of exiftool: ${?}" exit 0 ------ end of script ------ -- Floyd L. Davidson http://www.apaflo.com/ Ukpeagvik (Barrow, Alaska) |
#12
|
|||
|
|||
Is there a way to COPY EXIF information from one JPG to anotherin Linux?
On Wed, 15 Oct 2014 01:24:11 -0800, Floyd L. Davidson wrote:
But the file size is not a tag (use the -G option to see tag groups), it's just telling you what the actual file size is, and you can't change that with exiftool. I'm just slowly realizing that not everthing spit out by the basic exiftool command (or viewed in an EXIF editor) is an exif tag. Using the -G option, it looks like the groups (with an example) a [File] File Size : 65 kB [EXIF] Exif Image Width : 392 [MakerNotes] HDR Image Type : Original Image [XMP] XMP Toolkit : Image::ExifTool 9.46 [Composite] Image Size : 392x600 It's odd that the same thing (e.g., image size) is repeated over and over again in the EXIF tags. |
#13
|
|||
|
|||
Is there a way to COPY EXIF information from one JPG to anotherin Linux?
I am just curious as to why you want to copy EXIF?
-- |
#14
|
|||
|
|||
Is there a way to COPY EXIF information from one JPG to anotherin Linux?
Usenet Account wrote:
I am just curious as to why you want to copy EXIF? Some editors don't copy all of the Exif (note that it is not "EXIF") data. Also there is different data in RAW files that is not in the JPEG. But the main reason is to add or correct data in fields such as comments, copyright, and so on. Another is to fix lens identification tags... There are just a number of little reasons. -- Floyd L. Davidson http://www.apaflo.com/ Ukpeagvik (Barrow, Alaska) |
#15
|
|||
|
|||
Is there a way to COPY EXIF information from one JPG to anotherin Linux?
On 10/16/2014 6:31 AM, Whisky-dave wrote:
On Wednesday, 15 October 2014 16:45:50 UTC+1, Usenet Account wrote: I am just curious as to why you want to copy EXIF? -- Yes I've been wondering that. My comment is a lot less subtle. Considering who the poster is, the reason should be obvious. -- PeterN |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to ADD EXIF information to a JPEG photo | James Grady | Digital Photography | 9 | January 25th 14 03:17 AM |
exif information canon g9 | shirley | Digital Photography | 3 | April 2nd 08 07:28 AM |
Extracting EXIF information | Rob G | Digital Photography | 9 | February 9th 08 04:27 PM |
copy Exif from one image to another | Bucky | Digital Photography | 16 | December 24th 06 09:24 PM |
EXIF data - can it be transfered during copy-n-paste? | Ray Fischer | Digital Photography | 0 | October 15th 05 06:01 AM |