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

Add image editor #11746

Merged
merged 6 commits into from
Jul 4, 2023
Merged

Add image editor #11746

merged 6 commits into from
Jul 4, 2023

Conversation

ZetaTom
Copy link
Collaborator

@ZetaTom ZetaTom commented Jun 16, 2023

This change introduces an image editor, which enables users to crop, flip and rotate images on the fly. It supports a variety of different input formats, but is only able to produce JPEG, PNG and WEBP files as output due to the limitations of a system library.

ImageEditor

closes #11608


  • Tests written, or not not needed

@ZetaTom ZetaTom self-assigned this Jun 16, 2023
@ZetaTom ZetaTom force-pushed the image-editor branch 2 times, most recently from 41bfb10 to 4809f35 Compare June 21, 2023 11:24
@nextcloud-android-bot
Copy link
Collaborator

@nextcloud-android-bot
Copy link
Collaborator

@github-actions
Copy link

Signed-off-by: ZetaTom <[email protected]>
- reduce bottom margin of image editor control strip

Signed-off-by: ZetaTom <[email protected]>
- added some comments

Signed-off-by: ZetaTom <[email protected]>
- remove background colour from rounded_rect.xml

Signed-off-by: ZetaTom <[email protected]>
@github-actions
Copy link

Codacy

Lint

TypemasterPR
Warnings7677
Errors00

SpotBugs

CategoryBaseNew
Bad practice2626
Correctness8383
Dodgy code435435
Experimental22
Internationalization99
Malicious code vulnerability22
Multithreaded correctness99
Performance5656
Security1818
Total640640

Lint increased!

@github-actions
Copy link

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/11746.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@github-actions
Copy link

@tobiasKaminsky tobiasKaminsky merged commit 0b75f90 into master Jul 4, 2023
@delete-merged-branch delete-merged-branch bot deleted the image-editor branch July 4, 2023 12:27
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.26.0 milestone Jul 4, 2023
@surinder-tsys
Copy link
Collaborator

@ZetaTom I had one observation with this editor is that the size difference is more whenever we rotate the images.
Here are some findings:- 527 kb to 164 kb, 10 Mb to 7 Mb and 20 Mb to 15 Mb etc..

Is this much size reduction is expected or is there any way that it can be handled?

@ZetaTom
Copy link
Collaborator Author

ZetaTom commented Jul 13, 2023

@surinder-tsys Given the current implementation, this reduction in file size is to be expected as the image is re-compressed after each edit (after saving using ✅). This is handled by the Android-Image-Cropper Library. To avoid overwriting the original image with a version of inferior quality, we decided that edited images should be saved to a new file.

It would be possible to implement rotation functionality without changing the actual image data by manipulating only the corresponding EXIF fields associated with the image. This would result in an (almost) identical file and file size, although it would be rotated by the image viewer itself.

@surinder-tsys
Copy link
Collaborator

@ZetaTom Thanks for the explanation.
So the size reduction can not be avoided using Image-Cropper and this is expected and nothing can be done? Did I understood correctly?

@ZetaTom
Copy link
Collaborator Author

ZetaTom commented Jul 14, 2023

@surinder-tsys To my knowledge, we don't have any plans to change this behaviour.

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

Successfully merging this pull request may close these issues.

Add crop/resize functionality to photos
5 participants