Solution skill
How to get the original image file type (png, jpg, etc.) of an image?
Complete solution
How to get the original image file type (png, jpg, etc.) of an image?. You first have to fetch a list of all the images of the document with GET /v1/files/PROJECT_HASH. Use when hitting this exact issue. Not for unrelated errors or different features.
TL;DR
You first have to fetch a list of all the images of the document with GET /v1/files/PROJECT_HASH.
Fix
You first have to fetch a list of all the images of the document with GET /v1/files/PROJECT_HASH. Expected: you can confirm this matches your situation.
When to use
- You are dealing with this situation.
- The symptom matches: How to get the original image file type (png, jpg, etc.) of an image?.
When NOT to use
- Unrelated issues with a different cause.
- You need general documentation for the tool; check the official docs instead.
Compatibility
Reported per the linked source.
Variant phrasings
How to get the original image file type (png, jpg, etc.) of an image?
Why it happens
Stack Overflow question (score 0, has accepted answer): I am trying to export images used in layers. The image fills API (GET/v1/files/:key/images) returns a map of [ imageRef , URL ] but there's no way to know the image file type. For example, the URL doesn't have the file type. This is kind of a show stopper :( Ideally, I'd like to know the original file name and type(the actual image which the designer browsed), but just the file type is OK
Edge cases
- If your error message differs even slightly, this is probably a different issue; search the exact text.
- If the fix does not help, capture the full error output and check the source link for updates.
Evidence
Stack Overflow question (score 0, has accepted answer): I am trying to export images used in layers. The image fills API (GET/v1/files/:key/images) returns a map of [ imageRef , URL ] but there's no way to know the image file type. For example, the URL doesn't have the file type. This is kind of a show stopper :( Ideally, I'd like to know the original file name and type(the actual image which the designer browsed), but just the file type is OK Resolved: You first have to fetch a list of all the images of the document with GET /v1/files/PROJECT_HASH. Then, depending on the element name/id you have, you will cross check it against your list and get the corresponding file url. The file url is from amazon aws and it contains a file extension like .jpg, .png, etc.That's your actual image name, not that random hash that figma shows in the main json block. Source: https://stackoverflow.com/questions/61815382/how-to-get-the-original-image-file-type-png-jpg-etc-of-an-image
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_FHm-_de8GluMNuVLGMhh5Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">How to get the original image file type (png, jpg, etc.) of an image? <span>— Vectle</span></a>