Questions tagged [piexif]

28 questions
3
votes
2 answers

Add "Date Taken" Exif/XMP information to TIF file using Python

Using the following Python code on Windows 10, I am trying to edit the EXIF info for "Date Taken" on a tif image file created with Nikon Scan 4.0.3 (software from around 2008). import piexif def setImageDateTakenAttribute(filename,…
Håkon Seljåsen
  • 589
  • 5
  • 18
3
votes
1 answer

Django update InMemoryUploadedFile with Piexif

I am trying to strip out exif data on an uploaded image before continuing to do some other processing to it before saving to the server. I am using piexif as in this answer to strip out the exif metadata. However, piexif.insert() documentation…
user3750325
  • 1,502
  • 1
  • 18
  • 37
2
votes
1 answer

Modify jpg image Exif with Byte (UCS2) Type in javascript

I am trying to modify Exif data of a jpg using piexifjs module. it works well but for the most important and basic Tags like Title, Comment, Author... It doesn't work at all. var piexif = require("piexifjs"); var fs = require("fs"); var filename1 =…
Abraham
  • 12,140
  • 4
  • 56
  • 92
2
votes
1 answer

How to change camera model name of an image using python

I was trying to change camera model name using PIL and piexif library for python. It was a successful attempt but when i checked the images, the image size got reduced from 8-9 MB to 1-2 MB. How can i change the exif data without changing the image…
2
votes
1 answer

How to modify TIF file's EXIF data

I am trying to modify existing metadata within python 3. More specifically I have GPS coordinates and altitude in a my metadata, and I need to modify it. I'm using piexif mudule, and I ancounter two problems. First, I managed to change Altitude,…
Maxler
  • 23
  • 4
2
votes
2 answers

Overwrite GPS coordinates in Image Exif using Python 3.6

I am trying to transform image geotags so that images and ground control points lie in the same coordinate system inside my software (Pix4D mapper). The answer here says: Exif data is standardized, and GPS data must be encoded using geographical…
Avishek Dutta
  • 97
  • 2
  • 11
1
vote
1 answer

How to read image into base64 without losing EXIF data?

I'm trying to read one local image created with a different exif.Orientation based on the degrees that it was rotated. const exifData = piexif.load(data.toString("binary")); // Set the desired orientation value in the EXIF data …
Emmanuel Oliveira
  • 144
  • 1
  • 2
  • 14
1
vote
1 answer

Convert DMS to Decimal with PIEXIF on Python?

Here is the script I am Using Python 3: from print import print from PIL import Image import piexif codec = 'ISO-8859-1' # or latin-1 def exif_to_tag(exif_dict): exif_tag_dict = {} thumbnail = exif_dict.pop('thumbnail') …
Subu tex
  • 11
  • 1
1
vote
0 answers

How can I write a non-latin1 character into an exif tag using python?

As part of an app using Pillow, I want to update exif for a bunch of photos, including artist names, titles, etc. So far, I've been using piexif to do so. However I ran into an encoding problem: import PIL.Image import piexif img =…
1
vote
1 answer

How do you modify XPKeywords using piexif?

import piexif file = "download.jpeg" exif_dict = piexif.load(file) print(exif_dict) exif_dict["0th"][piexif.ImageIFD.XPKeywords] = "keyword;".encode("utf-16be") print(exif_dict) piexif.insert(piexif.dump(exif_dict), file) I tried to encode the…
jubin256
  • 11
  • 2
1
vote
0 answers

Cannot save EXIF data to a file

I'm trying to make an app which restores the original date of the picture (the time in which it was taken) by it's name as the name of the picture contains its date on Android phones but I can't save the EXIF data. No errors etc. it just does not…
Qiasm
  • 356
  • 6
  • 15
1
vote
2 answers

Error while trying to get the EXIF tags of the image

I'm trying to get the EXIF tags of an JPG image. To do this, I'm using piexif module. The problem is that I get an error - KeyError, saying this: Traceback (most recent call last): File "D:/PythonProjects/IMGDateByNameRecovery/recovery.py", line…
Qiasm
  • 356
  • 6
  • 15
1
vote
2 answers

Is there a way which I can add meta tags / keywords to an image using Python?

I have been searching for hours for the ability to edit / add tags or basically keywords of/to an image via Python. I wanted to change metadata of images so I had to use Piexif library and found it completely great but there is a problem which…
devkarim
  • 81
  • 9
1
vote
2 answers

how to normalise latitude into the range of -90 to 90?

Using piexif I got the DMS of Latitude and longitude which I am trying to convert in decimal degree, but for some images I am getting lattitude value as 184.62583333333333 which is out of the [-90,90] range. check out the code below, exif_dict =…
Gaurang Patel
  • 172
  • 3
  • 11
0
votes
0 answers

Adding EXIF GPS data to .jpg files using Python and Piexif

I am trying to write a script that adds EXIF GPS data to images using Python. When running the below script, I am getting an error returned from the piexif.dump() as follows: (venv) C:\projects\geo-photo>python test2.py Traceback (most recent call…
Mike Resoli
  • 1,005
  • 3
  • 14
  • 37
1
2