Forgot Password
Pentax Camera Forums Home
 

Reply
Show Printable Version Search this Thread
01-04-2012, 05:19 PM   #1
Site Supporter
Site Supporter
Wolfie665's Avatar

Join Date: Dec 2011
Photos: Gallery | Albums
Posts: 95
Poor Man Pentax M lenses EXIF aperture batch edit

I really enjoy my Pentax M lenses, but not having the manual apperture in EXIF is really annoying.

Here is short tip how to batch edit the EXIF. I use exiv2 command line tool.

Download exiv2 windows version installer from Exiv2 - Image metadata library and tools

Install exiv2, note I have changed install location to: c:\exiv2

You can use any location, but better avoid spaces in the path, hence default Programs is not very good idea.

Obviously you need to collect all the images with the same aperture in different folders in order to update them in batch.

Create one separate text file for each aperture F number in the exiv2 installation folder, here is example for f1.7, copy/paste the bold text only below in Notepad and name the file say cmd17.txt:


# Poor Man Pentax M lenses EXIF aperture batch edit
#
# Sample Exiv2 command file
# -------------------------
#

# download exiv2 windows version installer from Exiv2 - Image metadata library and tools

# How to batch change aperture for all files in directory:

# Note I usually drop all my files with same manual aperture in dedicated folder
#
# say C:\20120101\app17
# open command promt go there
# cd C:\20120101\app17
# then execute from
# c:\exiv2\exiv2 -m c:\exiv2\cmd17.txt *.JPG
#
# Note use this on your own riks, no claims accepted for any losses!!!
#

set Exif.Pentax.FNumber Short 17
set Exif.Photo.FNumber Rational 17/10

# added this line for my Pentax-M 50mm lens:
set Exif.Photo.FocalLength Rational 5000/100



open command promt go where the jpeg files for say f1.7 are by using cd command:

> cd C:\20120101\app17

then execute from command line:

> c:\exiv2\exiv2 -m c:\exiv2\cmd17.txt *.JPG

Which basically tells exiv2 tool to update all the files in the current folder (C:\20120101\app17) with the commands contained in cmd17.txt file.

You can create a files named: cmd28.txt, cmd56.txt, cmd22.txt, etc.

As you can see I have all the commands in the cmd17.txt file because I just copy paste from the text file to the command prompt, you can create a batch command files .bat to run commands directly.

In my exiv2 folder I kepp a batch file named:

runPentaxApp.bat

With content:

cd %1
c:\exiv2\exiv2 -m c:\exiv2\%2 *.JPG


Will do the same automatically. Run it and supply as first parameter the jpeg folder location and as second the cmd.txt file name:

> runPentaxApp.bat C:\20120101\app17 cmd17.txt

You can run it with different folder name and aperture text file settings:

> runPentaxApp.bat C:\20120101\app56 cmd56.txt

In my exiv2 folder I also keep set of cmdXX.txt files and I also find easier to keep a set of folders say C:\20120101\app17, C:\20120101\app56 etc,

I just copy/paste my new images say in C:\20120101\app17 folder, run the batch file and then copy/paste them in folders where I keep the shooting for given day.

This way I have only one set of cmdXX.txt and working folders.


To check changes you can run:

c:\exiv2\exiv2 -pt MyImageName.jpg

Here is the result from the -pt command listing all image EXIF data:

Exif.Image.Make Ascii 20 PENTAX
Exif.Image.Model Ascii 20 PENTAX K-r
Exif.Image.Orientation Short 1 top, left
Exif.Image.XResolution Rational 1 300
Exif.Image.YResolution Rational 1 300
Exif.Image.ResolutionUnit Short 1 inch
Exif.Image.Software Ascii 24 K-r Ver 1.11
Exif.Image.DateTime Ascii 20 2011:12:26 22:35:51
Exif.Image.Artist Ascii 12 VALKO YOTOV
Exif.Image.YCbCrPositioning Short 1 Co-sited
Exif.Image.Copyright Ascii 1
Exif.Image.ExifTag Long 1 706
Exif.Photo.ExposureTime Rational 1 1/1250 s
Exif.Photo.FNumber Rational 1 F1.7
Exif.Photo.ExposureProgram Short 1 Aperture priority
Exif.Photo.ISOSpeedRatings Short 1 12800
Exif.Photo.ExifVersion Undefined 4 2.30
Exif.Photo.DateTimeOriginal Ascii 20 2011:12:26 22:35:51
Exif.Photo.DateTimeDigitized Ascii 20 2011:12:26 22:35:51
Exif.Photo.ComponentsConfiguration Undefined 4 YCbCr
Exif.Photo.ExposureBiasValue SRational 1 0 EV
Exif.Photo.MeteringMode Short 1 Spot
Exif.Photo.Flash Short 1 No, compulsory
Exif.Photo.FocalLength Rational 1 75.0 mm
Exif.Photo.MakerNote Undefined 27608 (Binary value suppressed)
Exif.MakerNote.Offset Long 1 1144
Exif.MakerNote.ByteOrder Ascii 3 MM
Exif.Pentax.Version Byte 4 7.0.0.0
Exif.Pentax.Mode Short 1 Auto
Exif.Pentax.PreviewResolution Short 2 640x480
Exif.Pentax.PreviewLength Long 1 17413
Exif.Pentax.PreviewOffset Long 1 11356
Exif.Pentax.ModelID Long 1 (77420)
Exif.Pentax.Date Undefined 4 2011:12:26
Exif.Pentax.Time Undefined 3 22:35:51
Exif.Pentax.Quality Short 1 Best
Exif.Pentax.Flash Short 2 Off
Exif.Pentax.Focus Short 1 Manual
Exif.Pentax.AFPoint Short 1 Fixed Center
Exif.Pentax.ExposureTime Long 1 0.8 ms
Exif.Pentax.FNumber Short 1 F1.7
Exif.Pentax.ISO Short 1 (27)
Exif.Pentax.ExposureCompensation SShort 1 0 EV
Exif.Pentax.MeteringMode Short 1 Spot
Exif.Pentax.AutoBracketing Short 2 0 EV (No extended bracketing)
Exif.Pentax.WhiteBallance Short 1 Auto
Exif.Pentax.FocalLength Long 1 0.0 mm
Exif.Pentax.Saturation Short 1 Normal
Exif.Pentax.Contrast Short 1 High
Exif.Pentax.Sharpness Short 1 Hard
Exif.Pentax.DSPFirmwareVersion Undefined 4 254 244 234 241
Exif.Pentax.CPUFirmwareVersion Undefined 4 254 244 234 241
Exif.Pentax.EffectiveLV Short 1 27520
Exif.Pentax.ImageProcessing Undefined 4 Unprocessed
Exif.Pentax.PictureMode Byte 3 Aperture Priority (Off-Auto-Aperture)
Exif.Pentax.DriveMode Byte 4 Single-frame
Exif.Pentax.ColorSpace Short 1 sRGB
Exif.Pentax.PreviewImageBorders Byte 4 28 28 0 0
Exif.Pentax.LensType Byte 4 K,M Lens
Exif.Pentax.SensitivityAdjust Short 1 50
Exif.Pentax.DigitalFilter Short 1 Off
Exif.Pentax.Temperature SByte 1 30 C
Exif.Pentax.AELock Short 1 Off
Exif.Pentax.NoiseReduction Short 1 Off
Exif.Pentax.FlashExposureCompensation SLong 1 0 EV
Exif.Pentax.ImageTone Short 1 Bright
Exif.Pentax.ColorTemperature Short 1 0
Exif.Pentax.ShakeReduction Byte 4 1 7 223 150
Exif.Pentax.ShutterCount Undefined 4 238 7 192 213
Exif.Pentax.DynamicRangeExpansion Undefined 4 Off
Exif.Pentax.HighISONoiseReduction Byte 2 (255 4)
Exif.Pentax.AFAdjustment SShort 1 0
Exif.Pentax.BlackPoint Short 4 2 2 3 3
Exif.Pentax.WhitePoint Short 4 15744 8192 8192 11840
Exif.Pentax.ShotInfo Undefined 23 10 224 2 32 0 32 88 0 4 0 0 0 0 0 130 124 108 48 64 144 0 0 0
Exif.Pentax.AEInfo Undefined 25 151 0 88 64 0 168 3 32 162 0 72 72 140 32 64 0 75 44 81 17 1 0 0 0 72
Exif.Pentax.LensInfo Undefined 91 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Exif.Pentax.FlashInfo Undefined 39 1 0 240 63 0 0 0 0 0 0 0 0 0 86 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Exif.Pentax.AEMeteringSegments Undefined 16 74 75 78 74 56 54 75 71 54 43 79 74 65 66 68 59
Exif.Pentax.FlashADump Undefined 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Exif.Pentax.FlashBDump Undefined 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Exif.Pentax.CameraInfo Long 5 77420 20111001 2 2 8532982
Exif.Pentax.BatteryInfo Undefined 10 242 80 3 42 2 217 3 66 2 226
Exif.Pentax.AFInfo Undefined 19 0 32 224 32 0 3 2 55 31 31 13 19 0 0 0 0 125 0 124
Exif.Pentax.ColorInfo Undefined 18 32 131 31 100 31 125 32 156 33 72 32 246 31 51 31 10 0 0
Exif.Pentax.SerialNumber Ascii 20 4171662
Exif.Photo.FlashpixVersion Undefined 4 1.00
Exif.Photo.ColorSpace Short 1 sRGB
Exif.Photo.PixelXDimension Long 1 4288
Exif.Photo.PixelYDimension Long 1 2848
Exif.Photo.InteroperabilityTag Long 1 54468
Exif.Iop.InteroperabilityIndex Ascii 4 R98
Exif.Iop.InteroperabilityVersion Undefined 4 1.00
Exif.Photo.SensingMethod Short 1 One-chip color area
Exif.Photo.FileSource Undefined 1 Digital still camera
Exif.Photo.SceneType Undefined 1 Directly photographed
Exif.Photo.CustomRendered Short 1 Normal process
Exif.Photo.ExposureMode Short 1 Auto
Exif.Photo.WhiteBalance Short 1 Auto
Exif.Photo.FocalLengthIn35mmFilm Short 1 112.0 mm
Exif.Photo.SceneCaptureType Short 1 Standard
Exif.Photo.Contrast Short 1 Hard
Exif.Photo.Saturation Short 1 Normal
Exif.Photo.Sharpness Short 1 Hard
Exif.Photo.SubjectDistanceRange Short 1 Distant view
Exif.Image.GPSTag Long 1 54498
Exif.GPSInfo.GPSVersionID Byte 4 2.3.0.0
Exif.Image.PrintImageMatching Undefined 350 (Binary value suppressed)
Exif.Thumbnail.Compression Short 1 JPEG (old-style)
Exif.Thumbnail.XResolution Rational 1 300
Exif.Thumbnail.YResolution Rational 1 300
Exif.Thumbnail.ResolutionUnit Short 1 inch
Exif.Thumbnail.JPEGInterchangeFormat Long 1 54610
Exif.Thumbnail.JPEGInterchangeFormatLength Long 1 6087




I have used this for jpeg image types only, but it should work for any including raw types, just change the extension in *.jpg line.

Note use this on your own riks, no claims accepted for any losses whatsoever!!!

Happy shooting :-)

Here is an example of a photo with added aperture f number:



Link to EXIF metadata: Exif | Untitled | Flickr - Photo Sharing!


Last edited by Wolfie665; 01-27-2012 at 04:51 PM.
01-27-2012, 02:07 AM   #2
Junior Member




Join Date: Jan 2012
Posts: 39
Thank you, I needed something like this, and, as a Linux user I see it's free software developed on Linux, so I can try it.
01-27-2012, 04:15 PM   #3
Site Supporter
Site Supporter
Wolfie665's Avatar

Join Date: Dec 2011
Photos: Gallery | Albums
Posts: 95
Original Poster
QuoteOriginally posted by lordofthestrings Quote
Thank you, I needed something like this, and, as a Linux user I see it's free software developed on Linux, so I can try it.
glad you like it, note the batch comand file I am using are for Windows (I've used this only on Windows XP), but as you have said the main exiv2 library will work fine and if you want no problem to create bash scripts for Linux that will call it the same way I do with batch command .bat files.
Reply

Bookmarks
  • Submit Thread to Facebook Facebook
  • Submit Thread to Twitter Twitter
  • Submit Thread to Digg Digg
Tags - Make this thread easier to find by adding keywords to it!
aperture, batch, command, file, files, folder, photography, photoshop
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch edit of exif to add copyright Rick Digital Processing, Software, and Printing 41 08-04-2013 01:54 PM
How do I edit the EXIF data on my pictures on MAC? Student Photographic Technique 4 02-08-2011 03:08 PM
My Poor smc Pentax-M 50mm f1.7 (Aperture Blade Problem...) AaronBHicks Pentax SLR Lens Discussion 7 01-30-2011 11:00 AM
Wrong date set in my K7, is there a way to (batch) correct the EXIF info? dgaies Digital Processing, Software, and Printing 4 06-01-2010 09:10 AM
Edit Aperture Data In EXIF?? VIXIV Digital Processing, Software, and Printing 3 02-19-2010 02:29 AM



All times are GMT -7. The time now is 04:59 PM. | See also: NikonForums.com, CanonForums.com part of our network of photo forums!
  • Red (Default)
  • Green
  • Gray
  • Dark
  • Dark Yellow
  • Dark Blue
  • Old Red
  • Old Green
  • Old Gray
  • Dial-Up Style
Hello! It's great to see you back on the forum! Have you considered joining the community?
register
Creating a FREE ACCOUNT takes under a minute, removes ads, and lets you post! [Dismiss]
Top