Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Get mime-type of image in publishing plugin with lua

Community Beginner ,
Nov 02, 2021 Nov 02, 2021

Copy link to clipboard

Copied

For a LR publishing plugin I wanted to export also PNGs (additionally to JPGs) and wanted to get the mime-type of the LrPhoto. I couldn't find how to do this in the SDK-manual neither in the html-help.

I wanted to treat the uploaded files an metadata somewhat different, so I needed to know that.

Thank's in advance.

TOPICS
SDK

Views

32

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 02, 2021 Nov 02, 2021
photo:getRawMetadata ("fileFormat") returns the file type of the photo as displayed in the Library Filter bar's Metadata browser's File Type column.  My code uses this table to translate the result to a user-visible string (such as displayed in the Library Filter bar's Metadata browser):local FileTypeEnum = {{"Digital Negative (DNG)", "DNG", "DNG"}, {"HEIC", "HEIC", "HEIC"}, {"JPEG", "JPG", "JPG"}, {"Photoshop Document (PSD)", "PSD", "PSD"}, {"Photoshop Large Document (PSB)", "PSB...

Likes

Translate

Translate
LEGEND ,
Nov 02, 2021 Nov 02, 2021

Copy link to clipboard

Copied

photo:getRawMetadata ("fileFormat") returns the file type of the photo as displayed in the Library Filter bar's Metadata browser's File Type column.  My code uses this table to translate the result to a user-visible string (such as displayed in the Library Filter bar's Metadata browser):

local FileTypeEnum = {{"Digital Negative (DNG)", "DNG", "DNG"}, 
    {"HEIC", "HEIC", "HEIC"}, {"JPEG", "JPG", "JPG"}, 
    {"Photoshop Document (PSD)", "PSD", "PSD"}, 
    {"Photoshop Large Document (PSB)", "PSB", "PSB"}, 
    {"PNG", "PNG", "PNG"}, {"Raw", "RAW", "RAW"}, {"TIFF", "TIFF", "TIFF"}, 
    {"Video", "VIDEO", "VIDEO"}}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 03, 2021 Nov 03, 2021

Copy link to clipboard

Copied

LATEST

Great. Thank's. Don't know how I could miss that....

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines