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

Save file format for PNG now defaults to PBM/PGM/PPM (raw) #12

Open
leres opened this issue Dec 5, 2023 · 6 comments
Open

Save file format for PNG now defaults to PBM/PGM/PPM (raw) #12

leres opened this issue Dec 5, 2023 · 6 comments

Comments

@leres
Copy link

leres commented Dec 5, 2023

The FreeBSD graphics/xv port was updated from 3.10a to 4.2.0 about a month ago. Since then I've noticed that when I edit PNG files the default save file format is PBM/PGM/PPM. Previously the format always seemed to default to the original format of the file that was opened. I tested and that's the case for JPG, GIF, and WEBP.

This seems like a regression to me?

@tanabi
Copy link
Contributor

tanabi commented Dec 5, 2023

@leres Hey there;

Can you provide a specific example case? I just opened a PNG, cropped it, and tried to save it, and it defaulted to PNG format. So it is possible the problem you are encountering requires a specific set of steps, so let me know how to reproduce it and I'll see if there's something I can do about it.

Thanks!

@leres
Copy link
Author

leres commented Dec 5, 2023

If I download file_example_PNG_500kB.png from file-examples.com and then:

`xv file_example_PNG_500kB.png`

and type ^S the popup menu looks like this.

I looked at the port patches for xv but I don't see anything suspicious looking there.

@leres
Copy link
Author

leres commented Dec 5, 2023

Interesting. I unpacked the tarchive that poudriere uses to build the port and built it manually (with no patches) and the resulting xv binary behaves correctly!

@leres
Copy link
Author

leres commented Dec 5, 2023

Hum... I built xv inside a poudriere jail, added a DISPLAY variable, .Xauthority file, etc. and it behaves correctly. I assume this means there's something wrong with my desktop environment but I can't find it.

@tanabi
Copy link
Contributor

tanabi commented Dec 5, 2023

@leres Confirmed -- I downloaded the file (and got an interesting message about an invalid header that flashed up and disappeared before I could read it -- not sure if that is related!), hit ctrl-s, and I got the correct result (save as png).

If you can come up with a means to reproduce this, I am very happy to look at it though, so let me know if you can figure out a way to quantify it :)

@antofthy
Copy link

antofthy commented Apr 8, 2024

I recently noticed this too...
I had a screen crop of a color display, and the PNG file was saved at greyscale (no color in text image cropped).
However I needed it saved as a 8-bit sRGB PNG image (for use by "visgrep" for sub-image searching)
See my notes on visgrep at... https://antofthy.gitlab.io/info/apps/visgrep.txt

I don't think however it is xv's fault, as I had similar problems using ImageMagick to convert the image (same library)
However in ImageMagick I could save using 'png24' format to ensure I get sRGB format PNG
EG: convert image png24:screen.png

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

3 participants