sugarizer icon indicating copy to clipboard operation
sugarizer copied to clipboard

Resize images in fototoon

Open AdityaKrSingh26 opened this issue 11 months ago • 7 comments

Fix : #1551

Earlier the images were set as background image to the whole canvas as a result they were not resizable. In this fix i have made the images as a sperate globe which is resizable.

After fix:

https://github.com/user-attachments/assets/bbcf333e-e03a-4a1a-a26f-6ab30d66ad58

AdityaKrSingh26 avatar Jan 07 '25 22:01 AdityaKrSingh26

Hey @llaske please have a look at this

AdityaKrSingh26 avatar Jan 11 '25 11:01 AdityaKrSingh26

It's nice but it broke the way of using the activity. When the image icon is clicked it suppose to add a new page in the comic. Now it's no longer possible to add page.

llaske avatar Jan 12 '25 21:01 llaske

It's nice but it broke the way of using the activity. When the image icon is clicked it suppose to add a new page in the comic. Now it's no longer possible to add page.

okay ..... i was not aware of that feature. We can do 3 things:

  1. either add a button to add new page
  2. or add a new page when next page button is clicked if the current page is the last page.
  3. or we can also do one thing that on one page we can add only one image and when new image a new page is created.

AdityaKrSingh26 avatar Jan 13 '25 09:01 AdityaKrSingh26

The better option is the third.

llaske avatar Jan 14 '25 21:01 llaske

The better option is the third.

Okay i will work on this Just one thing i would like to make sure is that going with option 3 we will have only one image per page.

AdityaKrSingh26 avatar Jan 15 '25 05:01 AdityaKrSingh26

with option 3 we will have only one image per page.

yes, that's right

llaske avatar Jan 15 '25 20:01 llaske

hey @llaske please have a look at my latest commit, made the changes you mentioned. I have added the code for resizing the image and when new image is added a new page is created

Preview:

https://github.com/user-attachments/assets/3c3f16a5-16e1-41e7-9ff5-5cce8e62e11a

AdityaKrSingh26 avatar Mar 02 '25 19:03 AdityaKrSingh26

Good job. But when opening an existing Fototoon activity with the new version, it shrink images inside.

image

become:

image

llaske avatar Mar 12 '25 21:03 llaske

My older commit was not keeping the aspect ratio of image when it was first loaded. I have updated it so that the original aspect ratio of image is respected.

@llaske please have a look at my latest commit.

AdityaKrSingh26 avatar Mar 15 '25 07:03 AdityaKrSingh26

I've tested your latest PR, there is a memory leak issue. I've created a three redimensioned images project with some globes. After navigating several times from a page to another, images are not displayed or displayed at the wrong place. It's not happens on the original activity.

Capture vidéo du 2025-03-30 11-48-53.webm

llaske avatar Mar 30 '25 09:03 llaske

Got it ..... I'll try to fix this and update the pr

AdityaKrSingh26 avatar Mar 30 '25 12:03 AdityaKrSingh26

Hey @llaske please have a look at my latest commit. I have added :

  • A cleanup method to Clean up previous resources first and ensure when new comic box is loaded previous one is cleaned.
  • Created a completion handler to process any pending changes.

https://github.com/user-attachments/assets/7d96fc7d-d97c-47dd-9512-4b15a2d5f8b3

AdityaKrSingh26 avatar Apr 04 '25 18:04 AdityaKrSingh26

Hmmm it fix the issue but it's much less fluid, the user has to wait 1 second to switch between pages :disappointed:

llaske avatar Apr 05 '25 21:04 llaske

Hmmm it fix the issue but it's much less fluid, the user has to wait 1 second to switch between pages 😞

I am having difficulty understanding why this is happening ........... but I'll give it a try

AdityaKrSingh26 avatar Apr 06 '25 08:04 AdityaKrSingh26