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
bug: gvar_extended text missing from preview.png #90
Comments
That's very possible. Gonna be honest here: I haven't properly tested it as my station was down so I didn't have any recent data. It indeed doesn't init the images before writing. That's an easy fix though, so gonna work on it in a free moment. |
I did try an easy fix by initing all the images to (bar_height,previewImage.width()) but that had unexpected results, as the code that prints these images onto the final image expected the overlay images to only be as wide as the text in them, so one would have to init the images to the size of the text. |
Yeah, that was the easiest way to do it in CImg. I'll change up the code a bit and it will work just fine |
BTW, no rush. I only got plugins running last night, so this isn't disrupting or urgent. Just thought I'd file a bug for it... |
Alright! and thanks for letting me know, I wouldn't have seen it myself until I put my station back up which is gonna be in a few days... |
Great! Thanks. I also saw the weird aliasing. I'll take a look at the font scaling tonight, see if I can improve it. |
well, it's using bilinear resizing for it. This font just doesn't look very good when resized.. Roboto mono will do better here, it's a lot "thicker" |
(the font system, like the whole image lib is still very basic, so some things aren't done "properly" yet) |
Nice! Thanks! |
let me know if it all works well for you though |
It looks like, after the move to the new image lib, the text went missing from the preview.png image.
Looking at the code, the text is drawn on uninitialized image objects.
I don't know if the old image lib automatically expanded the image, but the new image lib checks that the pixels are within image bounds, and exists if not.
Images for text overlay created here:
https://github.com/altillimity/SatDump/blob/093bba360ceb3b6de65062f87ce6a7993929c872/plugins/gvar_extended/main.cpp#L122
Text written to overlay images here:
https://github.com/altillimity/SatDump/blob/093bba360ceb3b6de65062f87ce6a7993929c872/plugins/gvar_extended/main.cpp#L136-L138
draw_text uses draw_pixel which does bounds checking here:
https://github.com/altillimity/SatDump/blob/093bba360ceb3b6de65062f87ce6a7993929c872/src-core/common/image/image_drawing.cpp#L14-L15
The result is images that are still empty, even after the text was "drawn".
Either the draw_text function should expand the image, or the images must be created large enough to fix the text.
The text was updated successfully, but these errors were encountered: