Unable to overwrite original files
Brought to you by:
dr_saturn
When trying to overwrite the original files using the syntax:
pngnq -n 256 -e '.png' -f my.png
The result is:
rwpng_read_image() error
Saving using a different extension works fine. I tried adjusting permissions / ownership in case that was the issue, but with no luck.
Any suggestions?
That would be because pngnq opens the input file for reading then the output file for writing.
If they are the same then you try to read from a file now opened for writing.
I'll look into options to fix this behaviour. In the meantime I suggest wrapping
in a shellscript writing to a temporary file then moving to the original.
Thanks for the report.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
I've come across the same issue in pngnq 1.0. The man page references the fact that using -e .png and -f together will overwrite the original file, but yes, this error occurs. Full error, FWIW:
pngnq -e ".png" -f -n 192 original.png
pngnq - Error in pngnq.c near line 498 :
rwpng_read_image() error: 21
Thanks.
Fixed in svn. Now we close the input file before opening the output.