claviska / claviska/SimpleImage
Preserve exif data
- Dominant language
- PHP
- Stars
- 1.4k
- Forks
- 377
- PR merge metrics
- No merged PRs in 30d
Description
Because of the way GD works, exif data is discarded when an image is saved. It would be really nice to write this data back to the file when saved as `image/jpeg`.
On load, `$this->exif` gets populated from [`exif_read_data()`](http://php.net/manual/en/function.exif-read-data.php), so we have the info. We just need a way to write it back to the JPEG after it gets generated.
There are some seemingly bloated libraries for reading/writing exif data. I'd like to find a lightweight solution to handle this (prefer no third party deps).
- Add `setExif()` method (in case you want to overwrite or change it).
- Add `removeExif()` method (in case you want to remove it from the image).
- Ensure width, height, orientation, etc. exif properties are updated automatically when the image is resized or rotated.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the image load, JPEG save, resize, and rotate entry points around $this->exif and exif_read_data(). Define how EXIF can be set or removed without third-party dependencies, then verify that saving JPEGs preserves metadata and that width, height, and orientation stay correct after transformations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100