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

Panic on assert!(!result.is_null()) #644

Open
Python3-8 opened this issue Nov 16, 2023 · 2 comments
Open

Panic on assert!(!result.is_null()) #644

Python3-8 opened this issue Nov 16, 2023 · 2 comments

Comments

@Python3-8
Copy link

I recently wrote this program which edits an image and copies it to the clipboard with the arboard crate. I noticed this issue, where I get an assertion error with images of certain dimensions:
image
This image (1030x693) causes the above error:
image
When my program tries to copy its edited version to the clipboard, it's 1030x1030. I'm sure that this is specific to dimensions, because the program finishes successfully with this image (1030x694):
image
I found this line to be the one causing this panic, and the worst part is, I can't even use std::panic::catch_unwind because arboard's Clipboard struct doesn't implement UnwindSafe. I would appreciate any help.

@jrmuizel
Copy link
Collaborator

You'll need to find out why the call to CGImageCreate is failing. It seems to work for me locally:

target/debug/sqframe -i 283549138-b31ee63e-c52c-4dd5-9e29-b71bfdbe9354.png`
Opened image from "283549138-b31ee63e-c52c-4dd5-9e29-b71bfdbe9354.png"
Decoded image
Creating blurred background...
Upscale: done
Square crop: done
Gaussian blur: done
Background created
Constructing final image...
Done!
Overwrite clipboard content with edited image? [y/n]: y
Edited image copied to clipboard!

@Python3-8
Copy link
Author

Hey, thanks for replying and I'm sorry for not replying for so long. I've been busy with school and have exams coming up. I'm completely new to Rust, and I've never used C, so I have no idea where to start to research this problem. Do you have any suggestions, or ideas for me?

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

No branches or pull requests

2 participants