Plone 5 Image rotation - On Facebook they rotate!

As my customer says "On Facebook they rotate!"
How do I ensure that I get my images to rotate in Plone 5?

I'm sure this was working in Plone 4.


Do you mean auto rotation based on EXIF information?
There is a PR addressing this:

@pigeonflight if this is important to you, framework team would be happy if you could do an review of the plip. If all is fine we will merge it in 5.1

If you have any questions about the review process, do not hesitate to ask us.

related with this:

@zopyx.... yup strange!

Queue twilight zone music....
So I go to the plip and discover that I've already commented on it :astonished:

Auto-rotate would be great but an image transformation tab would be an acceptable middle ground.

@pigeonflight I do have additional code to make the image transformation tab work again, but it is based on this PLIP.
The PLIP is already full implemented and used in production, but need a review from someone to move into core.

And a review means, trying it out in your own code and then marking it as reviewed if it works (or something like that)?

Even my above question was answered in September.
@jensens yes I need some guidance around the review process, what are the steps? What's expected?

David, we have no template afaik (we should change this), but if you look at you find some examples. Dependent on the PLIP this can be brief up to complex. A brief one is A more complex one example is this

If you have any questions please just ask. I know we need to open the process more and be more transparent and welcoming here.

Thanks for the pointers. It's 1 week from PyCon Jamaica so I'm a bit distracted. Hopefully I can get back on this after that.

5 months later.......
I'm back, new customer just uploaded pics and no autorotation :frowning:
So.... I'm looking through the example reviews.

what version of plone.namedfile are you using? this was included in 4.1.1.

anyway, as mentioned above, whay may want is to restore the Transform tab on images.

I just tested this out on 5.1b2 which ships with plone.namedfile 4.2.0. When I upload a file which which has exif rotation data I get the following error:

2017-04-11 17:18:28 ERROR Zope.SiteErrorLog 1491949108.260.187152834679 http://localhost:8080/Plone/water-polo/album/++add++Image
Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module plone.z3cform.layout, line 63, in __call__
  Module plone.z3cform.layout, line 47, in update
  Module plone.dexterity.browser.add, line 134, in update
  Module plone.z3cform.fieldsets.extensible, line 65, in update
  Module plone.z3cform.patch, line 30, in GroupForm_update
  Module, line 145, in update
  Module, line 22, in execute
  Module z3c.form.action, line 98, in execute
  Module z3c.form.button, line 315, in __call__
  Module z3c.form.button, line 170, in __call__
  Module plone.dexterity.browser.add, line 105, in handleAdd
  Module, line 98, in extractData
  Module z3c.form.form, line 148, in extractData
  Module z3c.form.field, line 303, in extract
  Module plone.formwidget.namedfile.converter, line 43, in toFieldValue
  Module plone.namedfile.file, line 391, in __init__
  Module plone.namedfile.utils, line 225, in rotate_image
KeyError: 283

If the image does not require autorotation it works without an issue. It also autorotates successfully for some images.

Additionally I can't run a successful upgrade a Plone 5.1b2 site to Plone 5.1b3 (pending) but that's another issue.

I think it was in plone.namedfile 4.2.0, see

Interestingly this is not consistently an issue:

The image below is a png screenshot of a jpg image which has exif rotation data but is displayed as a a mirror image when rendered in a programme that is not exif aware (I used Clarisketch to display it like this)

Below is the original, which, when uploaded to plone, is rotated "correctly" (discourse also gets it correct)

The image below is NOT properly corrected by Plone, interestingly discourse gets this right also, but Plone 5.1b2 running plone.namedfile 4.2.0 does not.

In fact this is the image which caused the error noted above.

please open an issue regarding this.

@jensens it was in 4.1.1: I checked that on PyPI; seems like a small semantic versioning mistake.

Issue opened:

1 Like

Issue fixed