Can you change image display orientation?

111 views
Skip to first unread message

Mark S.

unread,
Mar 27, 2017, 8:05:54 PM3/27/17
to TiddlyWiki
I'm trying to make my own photo manager. Right off the bat I encountered a problem that some external images are not oriented correctly. The same images often display correctly when displayed through and image viewer. I suppose there is some internal info in the image that is ignored by the browser. Is there some way to give a hint to TW to display the image differently? I'm thinking the hint could be stored with each image so that it displays nicely.

Thanks!
Mark

Mat

unread,
Mar 28, 2017, 1:58:33 AM3/28/17
to TiddlyWiki
You could probably put the image or imagelink in a div that you style transform to show it at 90 degrees .

 transform: rotate({{!!myfield}}deg);

This general idea should work but I'm sure you must do some experimenting to actually get it to work ;-)

You could have the image itself be a button that toggles the angle when clicked.

<:-)

Ton Gerner

unread,
Mar 28, 2017, 4:43:17 AM3/28/17
to TiddlyWiki

Mark S.

unread,
Mar 28, 2017, 12:54:33 PM3/28/17
to TiddlyWiki
Apparently this is a known problem in FF since 2005 and possibly all browsers other than Mac (I haven't check the state of the art). The concern is that honoring the exif meta-data will break web-pages. In the past web pages were made by web developers who would be responsible for orienting their own photos. Today, more and more photos posted are coming directly from the cameras of ordinary, non-developer users.

At the moment I'm trying out a FF addon called imagetwist. It allows you to orient an image in place. I'd prefer if I could make TW5 apply the change, but was hoping to stick with the _canonical_uri approach. Applying some type of CSS would mean that I would need to use a macro instead of just the plain tiddler. Then again, maybe that's the way to go.

I would not want to physically alter the original image since that would almost certainly result in some (small) amount of data degradation plus change the original time stamp.

Thanks,
Mark

Mark S.

unread,
Mar 28, 2017, 2:19:52 PM3/28/17
to TiddlyWiki
More research. For firefox, there is a new CSS attribute:

image-orientation: from-image

This pretty much fixes things, as long as you're dealing with images that have the right meta-data.

The other CSS transforms didn't really work, because they applied the transforms *after* positions of the objects on the screen had been calculated.

Maybe this will help someone else --

Mark


On Monday, March 27, 2017 at 5:05:54 PM UTC-7, Mark S. wrote:
Reply all
Reply to author
Forward
0 new messages