deep_preset icon indicating copy to clipboard operation
deep_preset copied to clipboard

About light room script

Open DavieHR opened this issue 2 years ago • 2 comments

hi, i'm wondering how you can export Images using LrPhotos .... can you give me an example on it... Thank you.

DavieHR avatar Dec 08 '21 10:12 DavieHR

Hi, Thank you for asking. As described in the script for retouching:

local exportImage = require "exportImage"
-- ....
-- <some codes>
-- ....
local _out = outfolder .. tostring(i)
LrFileUtils.createDirectory(_out)
exportImage.exportPhotos(photos, _out)

We will export all photos at once. I don't remember where I referenced it. Here is the image export script.

local LrExportSession = import "LrExportSession"

local exportImage = {}

function exportImage.exportPhotos(photos, path, filename)
    local exportSession = LrExportSession({
    photosToExport = photos,
    exportSettings = {
        -- LR_collisionHandling = "rename",
        LR_export_bitDepth = "8",
        LR_export_colorSpace = "sRGB",
        LR_export_destinationPathPrefix = path,
        LR_export_destinationType = "specificFolder",
        LR_export_useSubfolder = false,
        LR_format = "PNG",
        -- LR_jpeg_quality = 1,
        LR_minimizeEmbeddedMetadata = true,
        LR_outputSharpeningOn = false,
        LR_reimportExportedPhoto = false,
        -- LR_renamingTokensOn = true,
        LR_size_doConstrain = true,
        LR_size_doNotEnlarge = true,
        LR_size_maxHeight = 5000,
        LR_size_maxWidth = 5000,
        LR_size_units = "pixels",
        LR_tokens = "{{custom_token}}",
        LR_tokenCustomString = filename,
        LR_useWatermark = false,
    }
    })
    exportSession:doExportOnCurrentTask()

end

return exportImage

There are more settings that can be found in API Document. Hope this helps.

minhmanho avatar Dec 09 '21 03:12 minhmanho

Thank you. I solved it by your recommendation! @minhmanho minhmanho

DavieHR avatar Dec 09 '21 09:12 DavieHR