Page 1 of 1

SVG <image> doesn't work in newer Puppies

Posted: Sun Nov 22, 2020 2:19 pm
by HerrBert

Hello.

Some time ago i used svg image files to create overlays for icons and wallpaper transitions. Still using this method in Slacko 6.3.2 and all works well, although there's a prefix not bound to a namespace. xmlns:xlink="http://www.w3.org/1999/xlink" is missing there. Found this mistake when browsing my icon directory with rox in ScPup64. There were no thumbnails for my overlayed icons and viewnior shows a blank, transparent box.

After i have updated all my svg files, they still don't display the images. Even rsvg-convert outputs an empty png file on ScPup64.
I can open these overlayed svg's with Inkscape Lite and my internet browsers (Palemoon, Light, Firefox).

Same problem in bionicpup64 and fossapup64.

Sample code for testing:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1"
     xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink"
     width="96"
     height="96">
  <image
     x="0"
     y="0"
     width="96"
     height="96"
     xlink:href="/usr/local/lib/X11/pixmaps/folder48.png" />
  <image
     x="48"
     y="48"
     width="48"
     height="48"
     xlink:href="/usr/local/lib/X11/pixmaps/archive48.png" />
</svg>

Can this be confirmed or did i miss something?


Re: SVG <image> doesn't work in newer Puppies

Posted: Fri Dec 18, 2020 2:04 am
by norgo

@HerrBert

usage of svg xml code for creation of a png overlay ?
to be honest this is a very strange method

I think mick's pngoverlay is exactly what you need

Code: Select all

pngoverlay-cairo-0.1

Generate a PNG file overlayed from a source and overlay A 48x48 PNG output icon is generated

Usage :
pngoverlay-cairo [source path] [overlay path] [output path] alid PNG paths are required

Re: SVG <image> doesn't work in newer Puppies

Posted: Fri Dec 18, 2020 4:26 pm
by HerrBert
norgo wrote: Fri Dec 18, 2020 2:04 am

@HerrBert

usage of svg xml code for creation of a png overlay ?
to be honest this is a very strange method

I think mick's pngoverlay is exactly what you need

Code: Select all

pngoverlay-cairo-0.1

Generate a PNG file overlayed from a source and overlay A 48x48 PNG output icon is generated

Usage :
pngoverlay-cairo [source path] [overlay path] [output path] alid PNG paths are required

It might be a strange method to you, but i didn't want to create new icons from scratch. The icons i used have an indexed palette and alpha channel, so editing them with mtpaint is no fun...
Also i'm not sure, if it is possible to create a small overlay from a 'full-sized' icon at the bottom-right corner with pngoverlay.

A search on the internet gives very few results, but if i understand it right, loading of images into svg got very restricted since librsvg-2.so.2.40.20, so it's not a bug (but also not soved here...)


Re: SVG <image> doesn't work in newer Puppies

Posted: Fri Dec 18, 2020 9:58 pm
by norgo

@HerrBert
pngoverlay creates and expect a size of 48x48 pixel.
to resize an overlay icon an place it in a corner is not possible,
but you can resize the overlay to the desired size an put it on a transparent background.
Here an example. It shows such a case.


Re: SVG <image> doesn't work in newer Puppies

Posted: Mon Jan 25, 2021 7:05 pm
by takenp

@HerrBert

I dare to suggest it can be a problem of ROX/JWM (version, compiling flags) Look into this way.


Re: SVG <image> doesn't work in newer Puppies

Posted: Wed Jan 27, 2021 12:18 am
by mikeslr

If alternatives suggested entail the possibility of work-overload, maybe try this solution: https://stackoverflow.com/questions/561 ... cape-linux

I think that among ImageMagick's many command-line options, https://imagemagick.org/script/command-line-options.php may be ones for managing indexed palettes and alpha channels. Note the Search box on the page. It leads to many discussions which, unfortunately, are above my pay-grade.

p.s. Taking your general interest in graphics into consideration, getting the hang of Imagemagick may be worth the effort.


Re: SVG <image> doesn't work in newer Puppies

Posted: Wed Jan 27, 2021 2:56 am
by Grey

Not entirely correct. <image> element itself work in newer Puppies. Another thing is that ROX and Viewnior shows only the vector part of the SVG file.
Insert the following classic construction into your sample, for example:

Code: Select all

  <g fill="yellow" stroke="red" stroke-width="8">
    <circle cx="40" cy="40" r="25" />
    <circle cx="60" cy="60" r="25" />
  </g>

And the thumbnail will appear, but Viewnior and ROX show only vector part with circles. The bitmap portion is not visible on the thumbnail. But Inkscape will show all three parts - two icons and circles.