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

fix: issues with windows displaying images #32

Merged
merged 6 commits into from
Aug 31, 2024

Conversation

Gipson62
Copy link
Contributor

This PR is intended to fix #26. I wouldn't call it a complete fix (it's still a work in progress), but at least it makes images viewable on Windows, they aren't too small. I'll still continue working on it in the future to try to get a perfect fix tho.

@Gipson62
Copy link
Contributor Author

Gipson62 commented Aug 30, 2024

Btw, I found winsafe if you prefer, so you don't have another crate (mine win-term) with just two functions in it. I can quickly change it if it bothers you. A friend of mine said it could lead to some security risk 😅

@josueBarretogit
Copy link
Owner

josueBarretogit commented Aug 31, 2024

Hey I find it really cool that you published a crate to solve this, if it doesn't take you too much time use winsafe, also if you need to call unsafe functions just remove the #![forbid(unsafe_code)] at main
also add [target.'cfg(windows)'.dependencies] so that it is only compiled for windows

@Gipson62
Copy link
Contributor Author

Done, I had to, sadly, remove the #[forbid(unsafe_code)] as winsafe didn't allow me to get the console window. Maybe it does, but as every huge documentation, it's surprisingly empty and impossible to understand...

Copy link
Owner

@josueBarretogit josueBarretogit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks this is going in the right direction, it must be a nightmare to work with the windows apis and their massively undocumentend crates so I appreciate your willingness to help. hopefully in the future bill gates adds the getConsoleFontSize idk

src/view/app.rs Outdated Show resolved Hide resolved
@Gipson62
Copy link
Contributor Author

Thanks this is going in the right direction, it must be a nightmare to work with the windows apis and their massively undocumentend crates so I appreciate your willingness to help. hopefully in the future bill gates adds the getConsoleFontSize idk

Not adding this function, but making it works 🤷‍♂️ . But the issue is: instead of using actually terminals/consoles nowadays, they start an app that emulate a terminal, so the app never get access to the font size of what it's emulating (yes that's dumb asf, don't ask me why)

Gipson62 and others added 2 commits August 31, 2024 21:49
reminder to automate formatting process and run `cargo fmt --check` only once in workflows
@josueBarretogit josueBarretogit merged commit 37e2cb9 into josueBarretogit:main Aug 31, 2024
4 checks passed
@Gipson62
Copy link
Contributor Author

Gipson62 commented Sep 1, 2024

I love open source, I had an issue with something, just went, fixed it, proposed the changes, and now it'll be fixed for everyone 🥳

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

Successfully merging this pull request may close these issues.

Images aren't displayed in the correct place or at the correct size
2 participants