Merge branch 'fix/bugs' into 'main'

fix: Fixed missing lens and incorrect user comment bug.

See merge request CodeByMrFinchum/optima35!20
This commit is contained in:
Mr Finchum 2025-01-23 13:56:37 +00:00
commit 303596e20c
2 changed files with 8 additions and 2 deletions

View file

@ -1,6 +1,10 @@
# Changelog
## 0.12.x
### 0.12.2: Bug fixes
- Fixed missing lens in meta data
- Fixed incorrect User Comment, aka, Scanner name
### 0.12.1
- Error in GitVersion.yml file resulted in jump from 6 to 12.

View file

@ -1,5 +1,6 @@
from PIL import Image, ImageDraw, ImageFont, ImageEnhance, ImageQt
import piexif
import piexif.helper
from fractions import Fraction
class ImageProcessor:
@ -117,7 +118,8 @@ class ExifHandler:
piexif.ImageIFD.YResolution: (72, 1),
}
exif_ifd = {
piexif.ExifIFD.UserComment: user_data["user_comment"].encode("utf-8"),
piexif.ExifIFD.LensModel: user_data["lens"].encode("utf-8"),
piexif.ExifIFD.UserComment: piexif.helper.UserComment.dump(user_data["user_comment"]),
piexif.ExifIFD.ISOSpeedRatings: int(user_data["iso"].encode("utf-8")),
piexif.ExifIFD.PixelXDimension: imagesize[0],
piexif.ExifIFD.PixelYDimension: imagesize[1],