Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataverse Theme + Widgets - Support SVG upload for Logo Image #2843

Closed
pameyer opened this issue Jan 5, 2016 · 12 comments
Closed

Dataverse Theme + Widgets - Support SVG upload for Logo Image #2843

pameyer opened this issue Jan 5, 2016 · 12 comments
Labels
Component: JSF Involves modifying JSF (Jakarta Server Faces) code, which is being replaced with React. Feature: Dataverse General Info Edit dataverse > "General Information" > Name, Alias, Email, Metadata Fields, et al... Help Wanted: Code Mentor: pdurbin Type: Suggestion an idea User Role: Curator Curates and reviews datasets, manages permissions UX & UI: Design This issue needs input on the design of the UI and from the product owner

Comments

@pameyer
Copy link
Contributor

pameyer commented Jan 5, 2016

Minor suggestion - allow for SVG (in addition to PNG, JPEG) or another vector graphics format for logo image uploads.

@pdurbin
Copy link
Member

pdurbin commented Jan 6, 2016

I confirmed this issue in the 4.2.3 branch (I'm on f641fe4). It says "The image could not be uploaded. Please try again with a jpeg, tiff, or png file.logo.svg"

screen shot 2016-01-06 at 9 43 52 am

$ grep 'The image could not be uploaded' src/main/java/Bundle.properties 
dataverse.theme.logo.image.invalidMsg=The image could not be uploaded. Please try again with a jpeg, tiff, or png file.

Here's where it's controlled:

<p:fileUpload invalidFileMessage="#{bundle['dataverse.theme.logo.image.invalidMsg']}" id="changelogo"
allowTypes="/(\.|\/)(jpg|jpeg|tff|png|gif)$/" update=":themeWidgetsForm:themeWidgetsTabView" oncomplete="bind_bsui_components();" dragDropSupport="true" auto="true" multiple="false"
fileUploadListener="#{themeWidgetFragment.handleImageFileUpload}" label="#{bundle['dataverse.theme.logo.image.upload']}"/>

https://github.com/IQSS/dataverse/blob/v4.2.2/src/main/webapp/themeAndWidgetsFragment.xhtml#L50

@pdurbin
Copy link
Member

pdurbin commented Jan 6, 2016

allowTypes="/(.|/)(jpg|jpeg|tff|png|gif)$/"

By adding "svg" to the list (twice, on lines 50 and 54, which should be refactored), I'm able to upload an SVG file from http://wiki.greptilian.com/greptilian.com/logo.svg

screen shot 2016-01-06 at 9 48 56 am

@mheppler @eaquigley @scolapasta is there any reason why we shouldn't allow SVG images in logos?

@pdurbin pdurbin added UX & UI: Design This issue needs input on the design of the UI and from the product owner Type: Suggestion an idea labels Jan 6, 2016
@pdurbin
Copy link
Member

pdurbin commented Jan 6, 2016

From what I understand svg is a much more web-friendly format that tff, which Dataverse supports for logo uploads.

@eaquigley
Copy link
Contributor

@pdurbin I have nothing against SVG as a file type for logo. Might have been an oversight or something that by default wasn't part of the primefaces component.

@scolapasta @mheppler

@pdurbin
Copy link
Member

pdurbin commented Jan 6, 2016

I just realized that while the SVG logo looks fine in the header the default logo appears in the cards:

Header (SVG logo appears):

header

Cards (no SVG logo, generic dataverse logo instead):

cards

Maybe this is why we don't support SVG? Not sure. @landreev might know what's going on with the cards.

@mheppler mheppler added the Feature: Dataverse General Info Edit dataverse > "General Information" > Name, Alias, Email, Metadata Fields, et al... label Jan 27, 2016
@pdurbin
Copy link
Member

pdurbin commented Feb 22, 2016

@bmckinney I don't think this issue is particularly high priority but maybe play around with the allowTypes regex above and see if you're getting the same results I am. Again, pulling in @landreev would be helpful for the cards.

@pdurbin
Copy link
Member

pdurbin commented Mar 17, 2016

@bmckinney @pameyer and I discussed this today. It's an issue but not at all a high priority. Unassigning @bmckinney .

@pameyer
Copy link
Contributor Author

pameyer commented Oct 13, 2016

To re-iterate, this isn't a blocker for us and is low priority.

@pdurbin
Copy link
Member

pdurbin commented Feb 2, 2017

This relates to #3559.

@mheppler mheppler changed the title support SVG for Logo Image under Theme+Widgets in dataverse configuration Dataverse Theme + Widgets - Support SVG upload for Logo Image Mar 6, 2017
@pameyer pameyer removed the SBGrid label Jun 19, 2017
@pdurbin
Copy link
Member

pdurbin commented Jun 25, 2017

@pameyer heh. Since you removed the SBGrid label, can we close this? 😄

@pdurbin pdurbin added the User Role: Curator Curates and reviews datasets, manages permissions label Jul 4, 2017
@jmjamison
Copy link
Contributor

I realize this isn't a high priority but adding svg would be nice - from a web graphics standpoint.

@djbrooke
Copy link
Contributor

djbrooke commented Oct 4, 2019

I took a quick pass at this last night to see if I could figure anything out and to try and understand more. It looks like imageio, which we use for converting these images to thumbnails in imagethumbconverter.java, does not support svg and that could be where it's falling over. :(

https://github.com/jai-imageio/jai-imageio-core

From our pom.xml:

com.github.jai-imageio jai-imageio-core 1.3.1

Note for us in the future if we ever decide to take this on is that we could investigate one that supports svg such as https://github.com/haraldk/TwelveMonkeys or take some completely different approach. Not sure of the tradeoffs for this. We'll leave this be for now.

@pdurbin pdurbin added the Component: JSF Involves modifying JSF (Jakarta Server Faces) code, which is being replaced with React. label Oct 8, 2022
@pdurbin pdurbin closed this as not planned Won't fix, can't repro, duplicate, stale Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: JSF Involves modifying JSF (Jakarta Server Faces) code, which is being replaced with React. Feature: Dataverse General Info Edit dataverse > "General Information" > Name, Alias, Email, Metadata Fields, et al... Help Wanted: Code Mentor: pdurbin Type: Suggestion an idea User Role: Curator Curates and reviews datasets, manages permissions UX & UI: Design This issue needs input on the design of the UI and from the product owner
Projects
None yet
Development

No branches or pull requests

7 participants