Menu

#6 Unable to overwrite original files

closed-fixed
nobody
None
5
2011-06-17
2009-03-18
No

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?

Discussion

  • Nobody/Anonymous

    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.

     
  • Anonymous

    Anonymous - 2010-09-08

    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.

     
  • Stuart Coyle

    Stuart Coyle - 2011-06-17

    Fixed in svn. Now we close the input file before opening the output.

     
  • Stuart Coyle

    Stuart Coyle - 2011-06-17
    • status: open --> closed-fixed
     

Log in to post a comment.