Image alt text not showing up in API request

Hi Folks,

I am trying to figure out why images in the Media Library have alt text, but then when I query our Prismic API and look at the data alt: null. Has anyone else run into this issue? I'm sure its the same image as the filenames match. It is not all images, just a handful of .svg we have.

I do not see any alt text for this specific image within the document where it is used, so I assume then it should inherit whatever is specified in the media library?

If anyone has seen this and has any insights let me know. Thanks!

Anton

Hi Anton,

Thanks for reaching out.

I have tried to upload some SVGs in one repository and couldn't reproduce the issue.

So In order to reproduce this issue, I would need your repository name (you can share it is a private message if necessary) as well as a link/name of the images that have the problem with the documents you are queuing from the API where the alt is not appearing.

Looking forward to your reply,
Fares

Sorry for my delay in reply. I will send you a PM with our repo name and the url of an example image

1 Like

Hi,

I've got the private message, I will try to reproduce the issue and will reach back to you.

Hi,

I've been able to reproduce the issue, and yes, the original alt of an SVG in the media library is not taken into consideration as a fallback:

So for that, I have created an issue in our tracker, and we will let you know in case of any updates.

Thanks so much for looking into this, I really appreciate it! I will look out for any updates from you on this issue.

1 Like

This thread is being monitored as an open ticket in the issue tracker. We will update this post as we get more information. If you have a similar use-case, you can ‘Flag’ this topic to reopen.

I've come across the same problem, an easy fix was to delete the image, re-uploading it and reassigning a alt text, then I was able to see it sent by the API and retrieve it into my code.

1 Like