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

Too slow cropping and result is too big #51

Open
appach22 opened this issue Jan 15, 2024 · 6 comments
Open

Too slow cropping and result is too big #51

appach22 opened this issue Jan 15, 2024 · 6 comments

Comments

@appach22
Copy link

Trying to crop a 5Mb jpeg image leads to 10 secs. cropping process and the resulting file size if about 50Mb.
If I crom a small jpeg image (about 80Kb) then the process is fast but still have large output (about 1.7Mb).
It seems like the the library firs makes a raw bitmap then crops it and again returns an uncompressed bitmap.
Would be great if output file is compessed with the same format and quality as the input image.
And for sure cropping process itself should be speed up.

@peter100u
Copy link

I also encountered this issue. The first one to use this library was the original file size of 451.41kb, but after completing the task, it was 1.3mb, which is obviously unreasonable. By the way, its size is also larger than the original file

@ikbendewilliam
Copy link
Collaborator

Our focus currently is on the customisability and getting images the same size. Feel free to look into speeding it up and creating a PR 🙂. I myself have no experience in optimising/compessing images 😬.

@chengwei88888
Copy link

我也遇到了这个问题。第一个使用这个库是451.41kb的原始文件大小,但在完成任务后,是1.3mb,这显然是不合理的。顺便说一下,它的大小也比原始文件

怎么解决的这个问题呢?

@peter100u
Copy link

我也遇到了这个问题。第一个使用这个库的原始文件大小是451.41kb,但是在完成任务后,是1.3mb,这显然是不太合理的。顺便说一下,它的大小也比原始文件大

这个问题怎么解决呢?

我现在并没有解决。。。。

@ikbendewilliam ikbendewilliam closed this as not planned Won't fix, can't repro, duplicate, stale Dec 30, 2024
@vanlooverenkoen
Copy link
Contributor

@ikbendewilliam maybe this one should not be closed but kept open and requesting help from the community. This is probably because the crop is done on the canvas. not on the image itself. And taking a snapshot of the canvas. I think in the future it would be better to not use the canvas for cropping. Although it has not been updated at least 4 people are having this issue and could maybe use some love. Having the ticket open allows other people to contribute 🤷 just a suggestion.

@ikbendewilliam
Copy link
Collaborator

@vanlooverenkoen The main reason I closed this is time, i'd love to give this package more love as it is being actively used, but that is not in my control atm. If anybody has the time, feel free to investigate. There are probably better/faster ways than using a canvas.
For now I'd suggest checking the size before adding it to the widget. In short term we could add a max-size argument maybe in the cropWidget that resizes before displaying and converting 🤔.

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

No branches or pull requests

5 participants