Skip to content
Snippets Groups Projects
Commit 3a44dc46 authored by Travis Ralston's avatar Travis Ralston
Browse files

Handle orientation of zero as no orientation

parent cd38ee2b
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
* Added a new tool, `export_synapse_for_import`, which can be used to do an offline import from Synapse.
* After running this tool, use the `gdpr_import` tool to bring the export into the media repo.
### Fixed
* Fixed thumbnails for invalid JPEGs.
## [1.2.0] - August 2nd, 2020
### Upgrade notes
......
......@@ -40,6 +40,11 @@ func GetExifOrientation(img io.ReadCloser) (*ExifOrientation, error) {
return nil, errors.New("exif: error parsing orientation: " + err.Error())
}
// Some devices produce invalid exif data when they intend to mean "no orientation"
if orientation == 0 {
return nil, nil
}
if orientation < 1 || orientation > 8 {
return nil, errors.New(fmt.Sprintf("orientation out of range: %d", orientation))
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment