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

Get mime-type of image in publishing plugin with lua

Community Beginner ,
Nov 02, 2021 Nov 02, 2021

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
309
Translate
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
...
Translate
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", "PSB"}, 
    {"PNG", "PNG", "PNG"}, {"Raw", "RAW", "RAW"}, {"TIFF", "TIFF", "TIFF"}, 
    {"Video", "VIDEO", "VIDEO"}}
Translate
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
LATEST

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

Translate
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