Closed Bug 717810 Opened 13 years ago Closed 11 years ago

rotate image functionality at least when using 'view image'

Categories

(Firefox :: Menus, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 298619

People

(Reporter: jidanni, Unassigned)

References

()

Details

User Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0a2) Gecko/20120106 Firefox/11.0a2 Iceweasel/11.0a2
Build ID: 20120106042007

Steps to reproduce:

Browsed a web page where the user did not rotate the image before posting.
So I looked around and all I could find was 'view image'.


Actual results:

There in 'view image' there is no additional menu items to rotate the image properly.

There I am, helplessly starting at a non-rotated image.


Expected results:

There in 'view image', more importantly than 'save image' should be 'rotate image...'.
Please don't mention adding add-ons.
Well, a quick workaround while waiting for this bug to be triaged, is to create a couple of bookmarklets. In Firefox 11 which centers the image already, you'd have:
Rotate left:
javascript:void(document.body.firstChild.style.MozTransform="rotate(90deg)")
Rotate right:
javascript:void(document.body.firstChild.style.MozTransform="rotate(270deg)")

In early Firefox versions you'd need a bookmarklet that does the centering, so for example Rotate left would be:
javascript:var a=document.body;var b=a.firstChild.style;a.style.backgroundColor="#222";a.style.margin="0";b.display="block";b.position="absolute";b.margin="auto";b.top="0";b.right="0";b.bottom="0";b.left="0";b.MozTransform="rotate(90deg)";void(0)
Glad to know, however me and my mom would find it easier to just remember to
1. stand up
2. rotate one's head 90 degrees.
Being that rotating the computer would shake/pull out the USB plug, etc.
Just hope nobody is staring at us at the library. :-)
I believe you will be able to save the text

javascript:void(document.body.firstChild.style.MozTransform="rotate(90deg)")

or

javascript:var a=document.body;var b=a.firstChild.style;a.style.backgroundColor="#222";a.style.margin="0";b.display="block";b.position="absolute";b.margin="auto";b.top="0";b.right="0";b.bottom="0";b.left="0";b.MozTransform="rotate(90deg)";void(0)

as a bookmark URL and click on that bookmark any time you need to rotate an image. It will be almost the same as clicking an item in a context menu.
Try it.
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Component: Untriaged → Menus
Ever confirmed: true
OS: Linux → All
QA Contact: untriaged → menus
Hardware: x86 → All
(In reply to :aceman from comment #3)
> Try it.
I'm sure it does... I'm just concerned about getting menu items added for the average user.
I'm guessing this is likely to be resolved WONTFIX due to the ability for site authors themselves to implement this as described at
http://hacks.mozilla.org/2011/11/html5-context-menus-in-firefox-screencast-and-code/

In case I guessed right, and someone wants to create an extension for sites that don't implement it themselves, after going to https://builder.addons.mozilla.org/ and clicking the "Create an add-on now" button, enter the following into the online main.js editor:

var contextMenu = require("context-menu");
exports.main = function(options, callbacks) {
  console.log(options.loadReason);
  var subMenu = contextMenu.Menu({
    label: "Rotate Image",
    context: contextMenu.SelectorContext("img"),
    contentScript: 'self.on("click", function (node, data) {' +
    'node.style.MozTransform=(data=="left"?"rotate(90deg)":"rotate(270deg)");' +
    '});',
    items: [
    contextMenu.Item({ label: "Left", data: "left" }),
    contextMenu.Item({ label: "Right", data: "right" })
    ]
  });
};
https://www.w3.org/Bugs/Public/show_bug.cgi?id=15401#c1 is looking at adding orientation in image metadata to DOM, so perhaps that or bug 298619 could help in any built-in implementation.
Depends on: exif
Blocks: 833511
Once CSS Image Values and Replaced Content Module Level 4 are implemented the following rule would allow web authors or Stylish extension users to force image orientation on pages to match that of EXIF metadata in an image:

img { image-orientation: from-image }
Duping against 298619 for the 'view image' EXIF rotation functionality. The CSS image-orientation property mentioned in comment 7 is being implemented in bug 825771.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.