Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZeroDivisionError: Caused by nan in GPS tags in EXIF Since release of Pillow 11.0 #8471

Closed
bashirmindee opened this issue Oct 16, 2024 · 1 comment
Labels

Comments

@bashirmindee
Copy link

What did you do?

Thank you for this amazing library <3.

Since release of Pillow 11.0, I have a problem rotating some files using Pillow.

What did you expect to happen?

rotated image to be produced in rotated_img

What actually happened?

ZeroDivisionError due to nan in GPS data.

What are your OS, Python and Pillow versions?

  • OS: Linux
  • Python: 3.11
  • Pillow: 11.0
Please paste here the output of running: python3 -m PIL.report

--------------------------------------------------------------------
Pillow 11.0.0
Python 3.11.10+ (heads/3.11:8b275e7, Sep  9 2024, 18:31:31) [GCC 13.2.0]
--------------------------------------------------------------------
Python executable is /home/bashir/mindee/teamMindee/input-pipeline/venv/bin/python3
Environment Python files loaded from /home/bashir/mindee/teamMindee/input-pipeline/venv
System Python files loaded from /home/bashir/.pyenv/versions/3.11-dev
--------------------------------------------------------------------
Python Pillow modules loaded from /home/bashir/mindee/teamMindee/input-pipeline/venv/lib/python3.11/site-packages/PIL
Binary Pillow modules loaded from /home/bashir/mindee/teamMindee/input-pipeline/venv/lib/python3.11/site-packages/PIL
--------------------------------------------------------------------
--- PIL CORE support ok, compiled for 11.0.0
--- TKINTER support ok, loaded 8.6
--- FREETYPE2 support ok, loaded 2.13.2
--- LITTLECMS2 support ok, loaded 2.16
--- WEBP support ok, loaded 1.4.0
--- JPEG support ok, compiled for libjpeg-turbo 3.0.4
--- OPENJPEG (JPEG2000) support ok, loaded 2.5.2
--- ZLIB (PNG/ZIP) support ok, loaded 1.3
--- LIBTIFF support ok, loaded 4.6.0
--- RAQM (Bidirectional Text) support ok, loaded 0.10.1, fribidi 1.0.13, harfbuzz 10.0.1
*** LIBIMAGEQUANT (Quantization method) support not installed
--- XCB (X protocol) support ok
--------------------------------------------------------------------
from PIL.ImageOps import exif_transpose
from PIL.Image import open as pil_open

filepath = "/path/to/file.jpg"

with pil_open(filepath) as pillow_img:
    rotated_img = exif_transpose(pillow_img)

output.jpg.tar.gz

@radarhere
Copy link
Member

radarhere commented Oct 16, 2024

#8474 will resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants