optipng: Error: Can’t back up the existing output file

  • Post author:
  • Post last modified:November 13, 2024
  • Reading time:1 mins read

1.0 Error

While running optipng on a png file, the following error was obtained,

Error: Can't back up the existing output file

2.0 Solution

The file was not having the write permission. Once, the write mode bit for the file was set, optipng worked fine.

$ ls -ls abc.png 
84 -r--r--r-- 1 alice dev 82981 Jan 30 05:04 abc.png
$ optipng abc.png
** Processing: abc.png
1024x512 pixels, 3x8 bits/pixel, RGB
Error: Can't back up the existing output file

** Status report
1 file(s) have been processed.
1 error(s) have been encountered.
$ chmod +w abc.png
$ optipng abc.png
** Processing: abc.png
1024x512 pixels, 3x8 bits/pixel, RGB
Input IDAT size = 82884 bytes
Input file size = 82981 bytes

Trying:
                               
abc.png is already optimized.

Karunesh Johri

Software developer, working with C and Linux.