I am on OSX, running python and trying to extra EXIF data from a large set of images in my library.
I've been using Pillow so far with my JPG photos and it works like a charm.
However, I stumbled on the first PNG photo I hit.
I am able to view a lot of the EXIF data on Mac though, using the photo inspector.
First, it seems that Pillow doesn't support __get_exif on PNGs.
Then I tried switching into pyexiv2, but that one hits an installation issue.
exiftool also didn't work for me.
Any idea whether there is a python way of extracting EXIF data on OSX?
PNG standard just started supporting EXIF in 2017 so make sure it's EXIF and not other metadata chunks that look like EXIF. See this Stack overflow question and answers for details.
You can use PyExifTool to extract EXIF data.
If you want to use a GUI you can use PyExifToolGui.
Make sure you have the latest version of the command line
ExifTool which recently added PNG EXIF support.
You say that ExifTool doesn't work for you but don't give any
details on what your issues are and perhaps you just need to update
your version. From the previously referenced thread the ExifTool author states ExifTool supports PNG EXIF:
The PNG group has recently been considering adding a new "eXIf" and/or
"zXIf" chunk to store EXIF information. ExifTool 10.43 added support
for "exIf" and "zxIf" chunks in support of this. – PhilHarvey May 26
'17 at 14:49
Related
I'm using OpenCV with Python, but actually can switch to C++, so if it's matter please answer question considering it.
I'm writing .avi file(joining multiple avi files into one) using
cv2.VideoWriter([filename, fourcc, fps, frameSize[, isColor]])
but recently found out that I can't write .avi file larger than 2 GB with it. It even mentioned there: Due to this OpenCV for video containers supports only the avi extension, its first version. A direct limitation of this is that you cannot save a video file larger than 2 GB.
But right now I've got no time to learn new library like ffmpeg, I need to do it very fast.
How can I write this file, using C++ or Python with knowledge of OpenCV, or at least with input part - using
cv::Mat
as frames
This limitation was removed in OpenCV 3.0, due to the introduction of new file formats such as .mkv, who do support video files larger than 2GB.
See Does OpenCV 3.0 Still Has Limits On VideoWriter Size?.
NOTE: The documentation and examples weren't updated yet, so maybe this should be considered experimental.
You have answered your own question but I'm afriad it isn't the answer you want.
From your link
As you can see things can get really complicated with videos. However, OpenCV is mainly a computer vision library, not a video stream, codec and write one. Therefore, the developers tried to keep this part as simple as possible. Due to this OpenCV for video containers supports only the avi extension, its first version. A direct limitation of this is that you cannot save a video file larger than 2 GB. Furthermore you can only create and expand a single video track inside the container. No audio or other track editing support here. Nevertheless, any video codec present on your system might work. If you encounter some of these limitations you will need to look into more specialized video writing libraries such as FFMpeg or codecs as HuffYUV, CorePNG and LCL.
What this paragraph says is that the developers of OpenCV made a design choice that says you cannot write video files larger than 2Gb using OpenCV for the specific reason that it is a computer vision library not a video tool.
Unfortunately if you want to write videos larger than 2Gb you are going to need to learn to use FFMPEG or something similar (It isn't that hard and has good bindings to OpenCV)
Anyone aware of some Python module or library capable of modifying EXIF and IPTC data in Adobe RAW files (.dng)? Until some eight years ago, I used JPEG and could rather easily do such modifications helped by Python. After having switched to RAW, I have to use image tools to modify EXIF info.
Primarily the EXIF Taken date is of interest to be modified, but some IPTC-fields are also candidates of modification.
(I'm geotagging photos from my cameras each of which have RTC's that creeps in various directions and amounts. My 'worst' camera 'hurries' ~2.4 sec per day. Before matching photodates with .gpx-data from a GPS-logger, I need to modify the Taken date with various amounts depending on number of days since cameraclocksetting.)
In one of my projects I use GExiv2 (https://wiki.gnome.org/Projects/gexiv2) with the PyGObject bindings (https://wiki.gnome.org/Projects/PyGObject). GExiv2 is a wrapper around exiv2, which can read & write Exif, IPTC and XMP metadata in DNG files: http://www.exiv2.org/manpage.html
I've been trying to parse Tiff and Jpeg image EXIF data using the BitStream module and just can't get it all going. Has anyone had better luck using it? If so, could you point me towards or can you share any example snippets?
I've spent a long time looking at and testing existing Python EXIF modules and so far all of them seem to be incomplete and unable to fully parse current EXIF image data.
I also looked at the Perl based EXIFTool which is a very complete tool, but when called from a Python shell call is 10x slower than calling native Python code to do the same.
This BitStream module really seems like it is the Python tool to use to parse binary data with.
Yet right now the learning curve has been steep.
The biggest problem I am running up against is all the EXIF Image Spec doc's just are not matching up to what I am seeing as I parse an image using BitStream.
It feels like I am getting closer here, but could use a little advice or code snippets from some others who have spent time parsing image file EXIF headers using BitStream and Python to get this back on track.
I am trying to use the Opencv VideoWriter object with the mpeg-1 encoding to create videos, I am aiming at writing only two images on that video, using mpeg-1 encoding, I would like to know how much the first image that I wrote first helps in compressing the second image. In other words find the file size before writing the 2nd image and after. My questions are:
Is there any way to perform this process using Opencv?
Is there a way to avoid writing on disks and just have the information of the size of the compreesed video( after adding the second image)?
Is there any other good alternatives reach my goals?
I suggest you learn GStreamer framework which has Python bindings available.
http://gstreamer.freedesktop.org/modules/gst-python.html
It works best on Linux platforms, some OSX support is available.
GStreamer provides "sane", but very powerful and very complex, APIs for procedural video and audio generation.
See also:
GStreamer: status of Python bindings and encoding video with mixed audio
Alternative you can write out frames to raw image images files and parse them to a video using ffmpeg command. Might work on Microsoft Windows platforms too.
I tried both exif.py (in Python) and ExifTool (just for debugging on command-line).
No matter what I do, I'm unable to extract image Tags or Rating added to a JPEG by Windows Live Photo Gallery.
I found similar reports of this issue here:
http://kott.fm/tomek/forums/topic/xmp-not-picking-up-wlpg-tags/
Does anybody have a solution?
Thanks
I eventually discovered there was some sort of caching scheme gone rogue within WLPG and it was not writing out the XMP tags to the image files. Deleting the "Pictures.pd6" file and rebooting solved the problem.