Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Implement image rotation in frontend #200

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

tognee
Copy link

@tognee tognee commented Jun 19, 2023

Currently just a PoC need help making it work reliably.

Implements changes made in LibrePhotos/librephotos#885 (Issue LibrePhotos/librephotos#856)

Currently it just calls the API endpoint to rotate the image. Ideally it would let the user rotate the image as much as they want and then when closing the LightBox or switching to another image it would send the rotation change to the backend (only when it got actually rotated)

Also after the backend call it should update the cached image and the grid view somehow, so that the user experience is seamless.

I tried updating the cache in my PoC but it doesn't seem to work.

Any help is appreciated!

@sonarcloud
Copy link

sonarcloud bot commented Jun 19, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@derneuere
Copy link
Member

You could add a save popup, when rotating. Would make it obvious when it gets actually saved.

If we go that route, then you need to add the rotating function to the LightBox dependency.

To do that, you have to manipulate the css class of this img tag. The rotation would be done in CSS

https://github.com/LibrePhotos/react-image-lightbox/blob/646cac0998f2479af8e3b4ec241f4ff498d8a33a/src/react-image-lightbox.js#L1413-L1425

You could maybe overwrite the addImage function to add the class for example with a call like I did here: https://github.com/LibrePhotos/librephotos-frontend/blob/bb1dd60f7db3e3d47e6599dd14a42a2e78082a64/src/components/lightbox/LightBox.tsx#LL115C40-L115C40

There is probably also a way to do that with a CSS selector, which just selects the in the LightBox, which could be easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants