• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

163

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
...

Votes

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"}}

Votes

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....

Votes

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