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

Support for large images #95

Open
domhof opened this issue Apr 4, 2021 · 14 comments
Open

Support for large images #95

domhof opened this issue Apr 4, 2021 · 14 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@domhof
Copy link

domhof commented Apr 4, 2021

Mantis requires the input image to be wrapped in an UIImage object but UIImage/UIImageView has issues with large images (see https://stackoverflow.com/questions/30941775/large-uiimage-not-showing-in-uiimageview), causing the image in Mantis to be black and the save button in Mantis not working (triggers an error message in the console: "CGBitmapContextInfoCreate: unable to allocate 1291540608 bytes for bitmap data").

Are there plans to support large images in the future?

@TaLinh
Copy link

TaLinh commented Sep 15, 2023

Hi @guoyingtao do you have any update about this issue?

@proloquor
Copy link

would appreciate an update on this, i'm encountering the same issue!

@guoyingtao
Copy link
Owner

@proloquor
I will keep working on it when I get more time. Would you mind uploading one large image you used here? Or just a down link is fine. Thank you!

@proloquor
Copy link

@guoyingtao i emailed you a link, thank you! :)

@guoyingtao
Copy link
Owner

@proloquor
Thanks for the test image you emailed. After debugging the code, the reason the cropping failed is not because of large image but the special image format. The cgImage of the photo shows its bitsPerPixel is 32 and bitsPerComponent is 10, it likely represents an image in a high dynamic range (HDR) format.
I haven't created CGContext for 10-bit image so currently I am using 16-bit image to preserve the image accuracy.

Please check #414 to see if it works for the similar images.

@proloquor
Copy link

proloquor commented Oct 9, 2024 via email

@guoyingtao
Copy link
Owner

@proloquor
PR #414 fixes the issue but it uses 16 bits image. If it is fine to reduce color accuracy, I can use 8 bits image as well or give user some config settings to choose preserving color accuracy or not.

@proloquor
Copy link

proloquor commented Oct 9, 2024 via email

@TaLinh
Copy link

TaLinh commented Oct 9, 2024

Hi @proloquor, do you mind sending me the photo you're having problem with? I would like to check if the crashes I'm experiencing is same as yours. Thank you in advance

@guoyingtao
Copy link
Owner

guoyingtao commented Oct 9, 2024

@proloquor The sample image can be correctly cropped if I use 16-bit CGCotext. You can try PR #414
The only issue is it will increase the memory usage. If it is a big issue then I can add using 8-bit CGContext too.

@proloquor
Copy link

proloquor commented Oct 9, 2024 via email

@guoyingtao
Copy link
Owner

@proloquor
Let me know if PR #414 works for you or not, then I can make a new release. Thank you!

@proloquor
Copy link

proloquor commented Oct 13, 2024 via email

@guoyingtao
Copy link
Owner

@proloquor
I just released Mantis 2.2.30 which fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants