and-rej / rotate-and-zoom-image

Is there a picture with wrong orientation, or just displayed too small? Rotate or zoom images directly on any website, just one in the context menu.
https://addons.mozilla.org/firefox/addon/rotate-and-zoom-image/
Mozilla Public License 2.0
16 stars 2 forks source link

Zoom and rotate can cause top left of image to become unviewable #29

Closed gaveitatry2 closed 3 years ago

gaveitatry2 commented 3 years ago

I wanted to provide you with an image example. So, I went to POF and I found a random female profile. I right-clicked one of her pictures and selected "open image in new tab". This was the resulting URL link.

https://pics.pof.com/dating/1180/3/51/5149aea79-8bee-4825-9ee9-3c6cdb432244.jpg

I then tried doing two things.

1.) I tried zooming in to 400%. Then I used the page's horizontal and vertical scrollbars to see other parts of the picture. On the left side of the image, it was missing a lot of her head. I could only see maybe half of her forehead. On the top side of the image, there was a lot of image missing to the right of her face.

2.) I then did a full reset and rotated the image 90% to the right. I then zoomed in to 400%. I used the page's horizontal and vertical scrollbars to see other parts of the picture. On the left side of the image, there was a lot of image missing to the left of her face. On the top side of the image, it was missing most of her head. I could only see the bottom 25% of her eyes and nothing above her eyes like her forehead or hair.

You may get slightly different results using the above steps, as it might be dependent on how big your browser is and what your desktop resolution is. I am using a 1600x900 desktop screen resolution (you can change desktop screen resolutions in Display Settings). And the browser window was sized to around 1050x870. The truth is, even if I made my browser a little bigger like 1600x870 (taskbar covers up the bottom 30px), I would still have the same problem. Like in second example, everything above her eyes would still be cropped out. If you tried to replicate this issue, I would suggest maybe temporarily changing your desktop resolution to 1600x900 just in case. And if you get slightly different results, maybe try using a larger zoom like 500% - 900%. But this problem definitely does exist. It's been bothering me so long that I just never used the feature. In fact, I was just now looking online for another Firefox extension that could replace yours. But I only found one where it just rotates the image 90% to the right each time that you use it. It did not have flip and zoom features. So I thought maybe if I could get you to fix your extension, I could just stick with yours. I have seen in a previous post where this was blamed on child page elements and stuff like that. But the URL I provided you with is goes directly to an image with no other page elements. I may be wrong, but I think that this bug affects rectangle shaped images and not square shaped images. It probably affects all image shapes though. I just looked on the closed issue dates and this was reported almost 13 months ago. I can't believe no one has reopened this issue or that the issue hasn't been worked on or fixed in those 13 months. Let's try this again. (fingers crossed)

and-rej commented 3 years ago

Hi there,

Thank you for reporting this issue. I've reproduced it thanks to the detail you provided.

It seems the top and left edges of the browser are special and we do not get scroll bars when we force the image past them.

I think I have a solution that will detect this and then translate the image down and to the right so it can be viewed in full. This may initially be a visible second step. I also have not tested right-to-left browsing yet which may have the opposite issue.

We should be able to release an improvement in the coming days.

Also, FYI, this extension has come under new management recently. We're hoping to address a lot of the feedback that's come in over the years.

gaveitatry2 commented 3 years ago

We should be able to release an improvement in the coming days.

No rush. It is just a matter of curiosity. But have you done any more testing since then?

and-rej commented 3 years ago

Hi there,

I've managed to fix the problem with rotate and zoom, but am having issues with the flip function.

The challenge is that when we rotate or flip we can kind of change the coordinate system (the x and y). So when we try to move "down and to the right" we need to reconcile all the transformations to move in the right direction.

@idgas01 would you be interested in trying out a pre-release version to see if it works for you in its current state? That would assist in our testing as well. I could probably get you a build in the next 24 hours.

gaveitatry2 commented 3 years ago

I can wait for the public release. I'm not in a hurry. Unless you want me to test it. Then just tell me how to get and install it. I am a bit preoccupied with some stuff right now, so it could take me a day or two before I test it. If that is okay.

and-rej commented 3 years ago

Just a little update. I've created the matrix below to show the testing progress. Basically it's working fine with rotating as indicated by the "Orientation" column and the first 4 rows. The flip feature is giving us grief however. Now that we can easily see which scenarios are not working I'm a bit more confident we can get it sorted promptly and do a release.

Thanks for your patience and I'll keep you updated.

rotate-zoom-testing

gaveitatry2 commented 3 years ago

No hurry. You can always separate the update into smaller ones too. Like the first update would be to fix the rotation on the FALSE, FALSE flipped images. Then take your time to figure out how to fix the rest and make that a separate update.

and-rej commented 3 years ago

I have not managed to make this fix work with flipped images. Instead I have disabled the fix for flipped images. Rotated and zoomed images should now be viewable.

I have created a new release 1.6 and it is now published to the add-ons page: https://addons.mozilla.org/firefox/addon/rotate-and-zoom-image/

I have also updated the title of this issue to better describe what it contains.

I will resolve this issue, but let me know if you experience any issues and we'll try our best to address them.

and-rej commented 3 years ago

This issue is now resolved.

gaveitatry2 commented 3 years ago

The 1.6 release isn't working for me. It's identical to before. I didn't go to the add-ons page. It already showed that the extension was updated to 1.6. Then I looked on my original post of this thread and tried the same image before and did the same steps as before. And the results were the same as before.

https://pics.pof.com/dating/1180/3/51/5149aea79-8bee-4825-9ee9-3c6cdb432244.jpg

1.) I tried zooming in to 400%. Then I used the page's horizontal and vertical scrollbars to see other parts of the picture. On the left side of the image, it was missing a lot of her head. I could only see maybe half of her forehead. On the top side of the image, there was a lot of image missing to the right of her face.

2.) I then did a full reset and rotated the image 90% to the right. I then zoomed in to 400%. I used the page's horizontal and vertical scrollbars to see other parts of the picture. On the left side of the image, there was a lot of image missing to the left of her face. On the top side of the image, it was missing most of her head. I could only see the bottom 25% of her eyes and nothing above her eyes like her forehead or hair.

and-rej commented 3 years ago

I actually experienced the same thing after the update was accepted by the add-ons marketplace. I had to remove the addon and re-add it from the product page. Then it worked. Could you try this for me before we proceed further?

gaveitatry2 commented 3 years ago

Removing the extension and then installing it again worked. I originally downloaded this extension because I just wanted to rotate images by 90 degrees. I don't think that I was worried about zoom at the time because my browser has the whole CTRL + or - to zoom in and out. And I hadn't even considered wanting the flip ability. Because in most instances, I'm okay with backwards mirror writing. If I want the image to be flipped bad enough, I can just download it and flip it. So this is just some feedback, but I wish that your extension was a lot simpler. But I know you can't make it simpler. Because the only way you could make it simpler is to remove all the features and make it rotate only. So forget about that feedback for now. One thing is you can kinda tell that this fix of yours is hacky. The way it systematically moves the image around when you zoom in and stuff. That's fine. I guess my biggest complaint is that the top edge and the left edge of the image, after zooming in, whether it is rotated or not has a pixel gap. I tried making a video. You can see the right and bottom edges of the picture have no gap. But the top and left sides do. But you can just ignore all of this and know that your extension works now, and that's a good thing! I can only imagine how much time you invested in trying to figure this out. Thank you! I'm interested in knowing if there are any other rotate image extensions out there that are simpler and work. I couldn't find any before, but I will probably keep my eyes peeled. But I'm pretty sure yours is the only good one out there. Thank you for your work and sorry for the delay in getting back with you.

https://user-images.githubusercontent.com/75463665/133438446-4c3296a9-a570-4887-b171-a92b7fc59ff7.mp4

and-rej commented 2 years ago

@SonofaNoob thank you for the detailed feedback. It's always appreciated.

That small gap is likely down to some math rounding we put in just to be absolutely sure the image is fully visible.

In any case, thanks for getting involved in the project.