-
Notifications
You must be signed in to change notification settings - Fork 338
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
Implement #392, take 2 #674
Implement #392, take 2 #674
Conversation
Will check those CI errors and try to fix them.. Excellent that you have valgrind in your build process! 👍 |
Apparently the function @tsipinakis I could check with the latest release and with the latest development branch version of gdk-pixbuf to see if it is already fixed or try to get it fixed if not. But nevertheless I guess you'd want me not to use this function as not to cause memory leaks when loading broken images? As an alternative, I could just load the image using the normal |
Weirdly enough I can't reproduce this with Debian stable or sid, which leads me to believe that this might've already been fixed and our CI images are simply out of date. It's also not clear if the leak is in gdk-pixbuf or librsvg, my bet is on the latter.
Eh, that's a bug that'll even if it's not fixed yet it'll be fixed by the time this is released and reaches the distros. There is no need to hold off to using that function IMO. On another note, some small TODOs for adding a new setting:
|
Oh! Duh! This is probably rsvg/147, our suppression file just didn't catch it because the stack trace changed with this PR. In this case you can just update |
Thanks for your feedback & review! |
Do you have any preferred default value for Also what is the purpose of the "default" values set in |
Are these out of sync?
|
I want to add that this solution is not taking DPI into account as @bebehei requested. If we want it to scale icons based on DPI as well, I guess we would need to determine a base DPI like 96 or something, and then scale images by |
If we go down the path of dpi-awareness I guess at least the following settings should be dpi-aware too:
|
Leaving it at 0 is fine, I don't think there's any real reason to have it enabled by default.
The default values in
Yes, images are reloaded on every redraw (perhaps wrongly) - So it can be done and there's also opportunity for optimization to avoid rescaling every time.
IMO this is out of the scope of this PR, let's not delay merging this. Either way I'll do the final review either tonight or tomorrow, thanks for implementing this! |
Yeah the dpi scaling is apparently experimental and not even documented in the pod.. I almost started writing a script already that ensures everything is documented but got distracted.. |
adc89db
to
667503e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the bug mentioned above everything else looks good. Thanks again for the contribution! :)
Do you want more tests for the scaling functionality? |
More tests are always better. I didn't mention anything about tests earlier because it didn't feel right asking for them when there aren't any for |
I will try next week. If you are in a hurry I can create a separate PR later. |
@xkr47 Ping? No pressure, just wanted to make sure you haven't forgotten about this. |
Thanks! Yeah bit busy but not forgotten :) |
There we go, got it done thanks to some well-timed motivation speech :) I split most of Let me know of any improvements/corrections/etc you'd wish to see. (The travis builds did not get very far and the failures feel totally unrelated to my code.) |
aa92d73
to
d08cee7
Compare
d08cee7
to
ad5d20b
Compare
LGTM, merged! Kudos for taking care of the tests as well, it's the part most people dread. |
Excellent news! It was a pleasure really, the codebase was easy to follow and the existing test helpers did most of the dreaded hard work already :) |
New attempt at #392, with great ideas from @tsipinakis taken into account. Have still not attempted to test/take into account any DPI-related functionality, so cannot say yet how/if it will affect the outcome.
Do you want more tests for the scaling functionality? Current tests pass.
Implementation details: I moved the scaling responsibility to the lowest functions in the call hierarchy involved in loading the images - both when loading from disk and from the notification message so responsibilities are clearer code-wise. Made some functions static that are no longer needed elsewhere.