Skip to main content
otavios60241350
Level 2
Apr 5, 2018 2:30 PM UTC
Solved

SVG is not showing on Google Chrome

[Thread Edited By Adobe]

/*Don’t forget to meet and greet your fellow peers virtually by telling them about yourself here. 

Go ahead and to it now: https://adobe.ly/3eDnB4v */

 

Actual Question:

Hi, I have some SVG files on my assets and I want use it on my component so a create a cq:dialog with a file field and on htl I am using properties global object, but the svg image are not working on chrome.

 

CODE:

file field:

 

<file

jcr:primaryType="nt:unstructured"

sling:resourceType="cq/gui/components/authoring/dialog/fileupload"

autoStart="{Boolean}false"

class="cq-droptarget"

fileNameParameter="./fileName"

fileReferenceParameter="./fileReference"

mimeTypes="[image/gif,image/jpeg,image/png,image/webp,image/tiff,image/svg]"

multiple="{Boolean}false"

name="./file"

title="Upload Image Asset"

uploadUrl="${suffix.path}"

useHTML5="{Boolean}true" />

 

HTL:

<img class="lines-about" src="${properties.fileReference}" alt="">

 

Result: Image not show if the image I select a SVG but if I select another type Image showing correctly.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
nileshdchavanAccepted solution
Level 2
Jun 29, 2018 2:01 PM UTC

Adobe advised to use the org.apache.sling.security-1.1.12.jar to fix this rendering issue. It worked for us. Thank you.

18 replies

qglez
Level 2
Jul 2, 2018 6:40 AM UTC

Thank you! It render fine now

Translate
sarav_prakash
Community Advisor
Community Advisor
Jul 3, 2018 6:18 PM UTC

This fix helps. But this works only for administrative users. This is still broken when logging in as Author. What is the permanent fix?

Translate
qglez
Level 2
Jul 5, 2018 7:02 AM UTC

In AEM 6.4 I've check with different users in different environments:

Author admin: svg renders

Author with an author account: svg renders
Publish with anonymous account: svg renders

Translate
Jul 23, 2018 1:42 PM UTC

Hi,

what do you mean by use org.apache.sling.security-1.1.12.jar? Just add it as dependency? For me, it does not affect anything.

Thank you,

Tobi

Translate
qglez
Level 2
Jul 24, 2018 6:21 AM UTC

Hi Tobias

Try to download the jar from the mvnrepository and installing it directly in the AEM instance http://localhost:4502/system/console/bundles

Translate
Jul 24, 2018 8:07 AM UTC

Thanks, that worked for me.

First I tried to install it with the package manager. That did - of cource - not work. I didn't know jars can be installed on the Felix consoles bundle page.

I learned something new. Thanks.

Translate
Adobe Employee
Aug 9, 2018 3:55 PM UTC

Thanks. It's really helpful.

Translate
Level 4
Nov 19, 2018 12:13 PM UTC

Installing an upgraded osgi org.apache.sling.security-1.1.16.jar corrects this issue (presumably adding the right headers into the response if  @fernandou23761826 's analysis of the problem is correct).

@ @kautuksahni​ is this the official solution?  how will this get rolled out, do i need to include sling security jar as a provided dependency along with custom code?

Translate