Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Scott Jacobs <scott092707@aol.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: x11-apps: /usr/bin/xcursorgen fails if config_file <filename>s contain full path and -p <prefix> is used as well
Bcc: Scott Jacobs <scott092707@aol.com>
Message-ID: <174758328202.213768.1914409976879514680.reportbug@ASUS-Prime-B350MA>
X-Mailer: reportbug 13.1.0
Date: Sun, 18 May 2025 11:48:02 -0400
X-Debbugs-Cc: scott092707@aol.com
Dear Maintainer,
I used xcur2png in a script on my cursor theme, so that I could remove all but
one size.
I then used xcursorgen to reconstitute the full theme (then copying in the
previous links).
I received "PNG error while reading" for each .png
After successfully reading the individual .png files with GIMP, eom, and
identify,
I eventually decided the .png files were fine, and that something else was
wrong.
In the source, I found that in load_image, if <prefix> exists, it (plus a '/')
is added
to the beginning of the <filename>s in the config_file, thus resulting in a
<path>/<file>
that did not exist, and could not be opened.
"New" cursors are often old cursors that are edited, or new glyphs added.
To edit or add, a cursor needs to be in .png format.
So a commonly used app xcur2png is used to split xcursors into png[s] and
config files.
xcur2png uses <path>/filename for each .png in the conf_file,
and xcursorgen, if used with -p option, tries to open
<prefix>/<path>/filename and fails.
From the manpage:
-p dir, --prefix dir
Find cursor images in the directory specified by dir. If not
specified, the current directory is used.
The average user may well think that the -p option is needed to tell xcursorgen
where the .pngs are.
Possible solutions:
1. fall back to using just <filename> if <prefix>/<filename> fails
2. add to manpage to caution user NOT to use -p option if config_file
<filename>s contain full path