Bug 35189 - Itemtypes SVG icons should be limited in height/width
Summary: Itemtypes SVG icons should be limited in height/width
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P4 normal
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-30 14:30 UTC by Pablo AB
Modified: 2024-07-30 14:14 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Screenshot (56.71 KB, image/png)
2023-10-30 14:30 UTC, Pablo AB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pablo AB 2023-10-30 14:30:43 UTC
Created attachment 158067 [details]
Screenshot

Steps to reproduce the issue:

1. On Staff interface, on Administration > Item types, modify any item
2. Choose an SVG image as a remote image for an Item type, for eg https://raw.githubusercontent.com/FortAwesome/Font-Awesome/afecf2af5d897b763e5e8e28d46aad2f710ccad6/svgs/solid/bolt.svg Save changes.

When listed on itemtypes.pl the icon is not too big, but if you edit again the itemtype (using above SVG, more than 1200px width).

This also impact at some degree on Advanced search (staff and OPAC, search.pl, opac-search.pl).
Comment 1 Owen Leonard 2023-10-30 18:41:49 UTC
I disagree that this is something Koha should handle. The remote images option assumes you're specifying an image which is sized correctly. Just because SVG images are scalable doesn't mean the image can't be created with a sane set of display dimensions.
Comment 2 Lucas Gass 2023-10-31 17:36:25 UTC
Koha can handle this via the UserCSS preferences. I'd rather let the user define height/width there.
Comment 3 Pablo AB 2023-10-31 19:46:16 UTC
Please check these screenshots https://imgur.com/a/P7iCx45

Sure, everything could be tune with OPACUserCSS/OPACUserJS/IntranetUserCSS/IntranetUserJS.

But, do we want _that_ to be the default behavior when using SVGs?

Moreover, Font Awesome have a huge catalog, referring directly to its SVG is very convenient.

Moreover2, all the places where this issue impact doesn't have a class to easily add a max-width, forcing to use more intricate strategies.
Comment 4 Owen Leonard 2024-07-30 14:14:14 UTC
(In reply to Pablo AB from comment #3)

> Moreover2, all the places where this issue impact doesn't have a class to
> easily add a max-width, forcing to use more intricate strategies.

I have submitted a patch for this issue in Bug 37515