beaulebens / keyring-social-importers

A collection of importers which pull your content back from social networks, and into your own WordPress install.
32 stars 17 forks source link

Flickr: photo orientation and rotation #20

Open ChrisHardie opened 6 years ago

ChrisHardie commented 6 years ago

In running a test import against my Flickr account, I noticed that many of the imported images are upside down. It's not currently practical to re-take all of those photos with a differently oriented camera.

In the meta information for one of these images on the Flickr page for it, it shows Orientation - Rotate 180 but that information is not available in the raw_import_data field in WordPress.

The Flickr API docs at https://www.flickr.com/services/api/flickr.photos.getInfo.htm don't mention orientation as a return value, but in using the API explorer at https://www.flickr.com/services/api/explore/flickr.photos.getInfo and a test image ID of 34000467050 I do see that information in the result: <photo ... rotation="180" ...>

So I guess unless there's a querystring param that can be appended to the fetching of an original image on the Flickr side, the importer would need to rotate an incoming image by the given amount somewhere along the way to the media library. An alternative might be to fetch the largest size on Flickr that is already auto-rotated, and use that as the main source image instead.