winecfg: Store the logo image in PNG format.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-10-18 14:42:10 +02:00
parent c3d8a29a04
commit d208b29d10
3 changed files with 7 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 KiB

After

Width:  |  Height:  |  Size: 132 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View file

@ -40,6 +40,8 @@ my $renderedSVGFileName = "$svgFileName.png";
my @pngFiles; my @pngFiles;
my @hotspot; my @hotspot;
$ENV{"SOURCE_DATE_EPOCH"} ||= "0"; # for reproducible builds
# Get the programs from the environment variables # Get the programs from the environment variables
my $convert = $ENV{"CONVERT"} || "convert"; my $convert = $ENV{"CONVERT"} || "convert";
my $rsvg = $ENV{"RSVG"} || "rsvg-convert"; my $rsvg = $ENV{"RSVG"} || "rsvg-convert";
@ -73,16 +75,16 @@ sub shell(@)
} }
# add an image to the icon/cursor # add an image to the icon/cursor
sub add_image($$) sub add_image($$$)
{ {
my ($file, $size) = @_; my ($file, $size, $depth) = @_;
if (defined $hotspot[$size]) if (defined $hotspot[$size])
{ {
my @coords = @{$hotspot[$size]}; my @coords = @{$hotspot[$size]};
push @icotool_args, "--hotspot-x=$coords[0]", "--hotspot-y=$coords[1]"; push @icotool_args, "--hotspot-x=$coords[0]", "--hotspot-y=$coords[1]";
} }
push @icotool_args, $size >= 128 ? "--raw=$file" : $file; push @icotool_args, ($size >= 128 && $depth >= 24) ? "--raw=$file" : $file;
push @pngFiles, $file; push @pngFiles, $file;
} }
@ -154,7 +156,7 @@ foreach my $element ($xc->findnodes("/x:svg/*[\@id]"))
{ {
shell $convert, $renderedSVGFileName, "-crop", "${width}x${height}+$x+$y", "-depth", $depth, $file; shell $convert, $renderedSVGFileName, "-crop", "${width}x${height}+$x+$y", "-depth", $depth, $file;
} }
add_image( $file, $size ); add_image( $file, $size, $depth );
} }
die "no render directive found in $svgFileName" unless @pngFiles; die "no render directive found in $svgFileName" unless @pngFiles;