tonytonyjan / exif

The fastest Ruby EXIF reader.
MIT License
150 stars 20 forks source link

Doesn't work with Panasonic Raw files (.cw2) #7

Open MtnBiker opened 7 years ago

MtnBiker commented 7 years ago

I think this gem would be great for me because of the speed advantage over mini_exiftool, but I get "RuntimeError: File not readable or no EXIF data in file."

mini_exiftool works as does exiftool from the command line. Obviously something is screening out the Raw files. I couldn't find any extension screening (which I might have been able to hack), but otherwise I haven't a clue.

tonytonyjan commented 7 years ago

Would you mind provide that image for me?

Since this gem is built with libexif, you can try the exif command to see if it still works:

$ brew install exif
$ exif xxx.jpg
MtnBiker commented 7 years ago

Thank you for your quick response. Appreciate your interest.

exif 2016.12.31-18.32.25.gs.P.rw2 Corrupt data The data provided does not follow the specification. ExifLoader: The data supplied does not seem to contain EXIF data.

exiftool 2016.12.31-18.32.25.gs.P.rw2 ExifTool Version Number : 10.05 File Name : 2016.12.31-18.32.25.gs.P.rw2 Directory : . File Size : 19 MB File Modification Date/Time : 2017:01:13 10:09:25-08:00 File Access Date/Time : 2017:01:13 15:07:28-08:00 File Inode Change Date/Time : 2017:01:13 12:45:24-08:00 File Permissions : rw-r--r-- File Type : RW2 File Type Extension : rw2 MIME Type : image/x-panasonic-rw2 Exif Byte Order : Little-endian (Intel, II) Panasonic Raw Version : 0330 Sensor Width : 4816 Sensor Height : 3464 Sensor Top Border : 8 Sensor Left Border : 8 Sensor Bottom Border : 3456 Sensor Right Border : 4600 Black Level 1 : 1 Black Level 2 : 4 Black Level 3 : 12 Linearity Limit Red : 4095 Linearity Limit Green : 4095 Linearity Limit Blue : 4095 ISO : 3200 High ISO Multiplier Red : 1 High ISO Multiplier Green : 1 High ISO Multiplier Blue : 1 Black Level Red : 128 Black Level Green : 128 Black Level Blue : 128 WB Red Level : 419 WB Green Level : 265 WB Blue Level : 710 Num WB Entries : 7 WB Type 1 : Fine Weather WB RGB Levels 1 : 640 256 412 WB Type 2 : Cloudy WB RGB Levels 2 : 673 256 386 WB Type 3 : Shade WB RGB Levels 3 : 726 256 364 WB Type 4 : Tungsten (Incandescent) WB RGB Levels 4 : 439 256 596 WB Type 5 : Flash WB RGB Levels 5 : 657 256 379 WB Type 6 : D55 WB RGB Levels 6 : 597 256 410 WB Type 7 : ISO Studio Tungsten WB RGB Levels 7 : 439 256 596 X Resolution : 180 Y Resolution : 180 Resolution Unit : inches Software : Ver.1.3 Modify Date : 2017:01:01 02:32:25 Y Cb Cr Positioning : Co-sited Sensitivity Type : Standard Output Sensitivity Components Configuration : Y, Cb, Cr, - Compressed Bits Per Pixel : 2 Light Source : Unknown Image Quality : Raw Firmware Version : 0.1.3.0 White Balance : Auto Focus Mode : AF-C AF Area Mode : 1-area Image Stabilization : On, Mode 1 Macro Mode : Off Shooting Mode : Program Audio : No Data Dump : (Binary data 8200 bytes, use -b option to extract) Flash Bias : 0 Internal Serial Number : (F97) 2013:11:07 no. 0313 Panasonic Exif Version : 0405 Color Effect : Off Time Since Power On : 00:02:18.86 Burst Mode : Off Sequence Number : 0 Contrast Mode : High Noise Reduction : Standard Self Timer : Off Rotation : Horizontal (normal) AF Assist Lamp : Disabled but Required Color Mode : Normal Baby Age : (not set) Optical Zoom Mode : Standard Conversion Lens : Off Travel Day : n/a Contrast : Normal World Time Location : Home Text Stamp : Off Program ISO : Intelligent ISO Advanced Scene Type : 1 Faces Detected : 0 Saturation : Normal Sharpness : Normal Color Temp Kelvin : 2900 Bracket Settings : No Bracket WB Shift AB : 0 WB Shift GM : 0 Flash Curtain : n/a Long Exposure Noise Reduction : Off Panasonic Image Width : 4592 Panasonic Image Height : 3448 AF Point Position : 0.61 0.49 Num Face Positions : 0 Lens Type : LUMIX G VARIO 14-140/F4.0-5.8 Lens Serial Number : 09090083294 Accessory Type : NO-ACCESSORY Accessory Serial Number : 0000000 Lens Firmware Version : 0.1.4.0 Faces Recognized : 0 Title : Baby Name : Landmark : Intelligent Resolution : Standard Burst Speed : 0 Intelligent D-Range : Standard Clear Retouch : Off City 2 : Photo Style : Vivid Shading Compensation : Off Accelerometer Z : 270 Accelerometer X : -8 Accelerometer Y : 77 Camera Orientation : Normal Roll Angle : -1.3 Pitch Angle : -12.9 Sweep Panorama Direction : Off Sweep Panorama Field Of View : 0 Timer Recording : Off Internal ND Filter : 0 HDR : Off Shutter Type : Electronic Clear Retouch Value : undef Touch AE : Off Maker Note Version : 0145 Scene Mode : Off Flash Fired : No Flashpix Version : 0100 Color Space : sRGB Exif Image Width : 1920 Exif Image Height : 1440 Interoperability Index : R98 - DCF basic file (sRGB) Interoperability Version : 0100 Sensing Method : One-chip color area Scene Type : Directly photographed Custom Rendered : Normal Exposure Mode : Auto Digital Zoom Ratio : 0 Focal Length In 35mm Format : 30 mm Scene Capture Type : Standard Gain Control : High gain up PrintIM Version : 0250 Compression : JPEG (old-style) Thumbnail Offset : 14548 Thumbnail Length : 6494 Encoding Process : Baseline DCT, Huffman coding Bits Per Sample : 8 Color Components : 3 Y Cb Cr Sub Sampling : YCbCr4:2:2 (2 1) Jpg From Raw : (Binary data 609466 bytes, use -b option to extract) Make : Panasonic Camera Model Name : DMC-GX7 Strip Offsets : 4294967295 Orientation : Horizontal (normal) Rows Per Strip : 3464 Strip Byte Counts : 0 Raw Data Offset : 614676 Distortion Param 02 : 0.0072021484375 Distortion Param 04 : 0.018829345703125 Distortion Scale : 1 Distortion Correction : On Distortion Param 08 : 0.104278564453125 Distortion Param 09 : 0.0062255859375 Distortion Param 11 : -0.0234375 XMP Toolkit : Image::ExifTool 10.05 Country Code : US Location : Clifton Country : United States Instructions : 2017-01-01 02:32:25 UTC. Time zone of photo is GMT -8 unless TS5? State : California Usage Terms : 19687 seconds from nearest GPS point Current IPTC Digest : 8380ccab7d1912f0b3f972fed7aa7885 Source : P1320428.RW2 Application Record Version : 4 Special Instructions : Lat 33.836709, Lon -118.377721 - Bearing: unknown - Altitude: 42m City : Redondo Beach Exposure Time : 1/13 F Number : 4.1 Exposure Program : Program AE Time Zone Offset : -8 Exif Version : 0230 Date/Time Original : 2017:01:01 02:32:25 Create Date : 2017:01:01 02:32:25 Exposure Compensation : 0 Max Aperture Value : 4.1 Metering Mode : Multi-segment Flash : Off, Did not fire Focal Length : 15.0 mm File Source : Digital Camera GPS Version ID : 2.3.0.0 GPS Latitude Ref : North GPS Longitude Ref : West GPS Altitude Ref : Above Sea Level GPS Time Stamp : 08:00:32 GPS Map Datum : WGS-84 GPS Processing Method : GPS GPS Date Stamp : 2017:01:01 Advanced Scene Mode : Off Aperture : 4.1 Blue Balance : 2.679245 GPS Altitude : 42 m Above Sea Level GPS Date/Time : 2017:01:01 08:00:32Z GPS Latitude : 33 deg 50' 12.15" N GPS Longitude : 118 deg 22' 39.80" W GPS Position : 33 deg 50' 12.15" N, 118 deg 22' 39.80" W Image Height : 3448 Image Width : 4592 Lens ID : LUMIX G VARIO 14-140mm F4.0-5.8 Red Balance : 1.581132 Scale Factor To 35 mm Equivalent: 2.0 Shutter Speed : 1/13 Thumbnail Image : (Binary data 6494 bytes, use -b option to extract) Circle Of Confusion : 0.015 mm Field Of View : 61.9 deg Focal Length : 15.0 mm (35 mm equivalent: 30.0 mm) Hyperfocal Distance : 3.65 m Image Size : 4592x3448 Light Value : 2.8 Megapixels : 15.8

Friends made up for a New Years Eve party. A random picture I used as a sample.

I added the gps information with gpsPhoto.pl via a Ruby script. I use mini_exiftool to get and write other information to the file and determine the filename.

I saved a version of the file as .jpg and your gem works fine.

Feel free to ask other questions.

Greg

On Jan 13, 2017, at 3:05 PM, 簡煒航 (Jian Weihang) notifications@github.com wrote:

Would you mind provide that image for me?

Since this gem is built with libexif, you can try the exif command to see if it still works:

$ brew install exif $ exif xxx.jpg — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tonytonyjan/exif/issues/7#issuecomment-272572116, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIeqAfHhd467-hI0CJ47o1Eofzdhlfdks5rSAMmgaJpZM4LjYib.

MtnBiker commented 7 years ago

Here's the link to the image as it didn't seem to make it via email. Not sure how to insert, but download linked file works for me. Greg

MtnBiker commented 5 years ago

Just checking back. Just installed on a new computer and still doesn't work. $exif filename >> exif: command not found. And tried in a Ruby script and got File not readable or no EXIF data in file. (Exif::NotReadable)