Ranjan Maitra via users wrote:
> [As a note, upstream is in trouble because the maintainer
> is quite unwell, judging by the ticket responses on the
> slimfork site. I hope he recovers well and soon, at least
> for his sake.]

Yes, I hope they get well soon.

> So, I think that there are two options: one, perhaps a
> long-term one would be to add code that allows for reading
> .jxl files. That is doable and a lot of work, but might
> only be transient as Fedora moves to something else down
> the road.
> 
> So, I was thinking of using magick to convert the file to
> a png while the rpm was being built. Might not be kosher
> anyway, but I brought in ImageMagick as a BuildRequire,
> and replaced:
> 
> ln -s ../../../backgrounds/f%{?fedora}/default/f%{?fedora}-01-day.png 
> %{buildroot}%{_datadir}/%{name}/themes/default/background.png
> 
> with:
> 
> magick ../../../backgrounds/f%{?fedora}/default/f%{?fedora}-01-day.jxl 
> convert %{buildroot}%{_datadir}/%{name}/themes/default/background.png
> 
> I don't know why this creates the following error:
> 
> magick ../../../backgrounds/f42/default/f42-01-day.jxl 
> /home/localuser/rpmbuild/BUILD/slim-1.4.0-build/BUILDROOT/usr/share/slim/themes/default/background.png
> 
> magick: unable to open image 
> '../../../backgrounds/f42/default/f42-01-day.jxl': No such file or directory 
> @ error/blob.c/OpenBlob/3596. error: Bad exit status from 
> /var/tmp/rpm-tmp.62ipD8 (%install)
> 
> RPM build errors:
>     Bad exit status from /var/tmp/rpm-tmp.62ipD8 (%install)
> 
> I do not quite understand why I get this error, especially
> because the "ln -s" appears to find this path. 

'ln -s' works because it doesn't actually need the target to
create the link.  If you did a build in mock and then looked
for the target file in the chroot, it's not there because
there's no BuildRequires for f%{?fedora}-backgrounds-base,
only a Requires.

That ensures it is there at install time, so the symlink
works.  You'd need to add a BuildRequires to get
f%{?fedora}-backgrounds-base installed in the package
buildroot where you can use magick to convert it.

Once you're not making a symlink, I think using the absolute
path makes things clearer.  Having to keep track of where
you are relative to the backgrounds directory is a minor
hassle, which has no real benefit when you're converting the
file and saving it at another path.  In other words:

    magick %{_datadir}/backgrounds/f%{?fedora}/default/f%{?fedora}-01-day.jxl \
        %{buildroot}%{_datadir}/%{name}/themes/default/background.jpg

You don't need to specify convert in the magick command.
Using magick as above will convert the file from jxl to jpg
(or png if you change the extension).

It may be worth comparing the size and quality of jpg versus
png.  It takes about 4 times as long to convert to png as
jpg (2.8 vs 0.6 seconds) and is about that many times larger
as well (6.4M vs 1.4M).

Neither the time nor size for the png is too much.  I just
noticed it while doing this in a container to test.  The
input jxl file is under 1M, FWIW.

-- 
Todd

Attachment: signature.asc
Description: PGP signature

-- 
_______________________________________________
users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to