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

Generating resized images in a publishing service.

Engaged ,
Mar 25, 2017 Mar 25, 2017

Copy link to clipboard

Copied

I have a publishing services, sends images to a web site over FTP with some xmlrpc mixed in. I need resized versions of the images for thumbnails, full screen, etc. I've been generating them on the site but I'm running into CPU limit issues with my hosting service so I need to generate them locally and send. There doesn't seem to be an immediate way to do this within Lightroom. I can do it easily enough using ImageMagick but that seems daft given where I'm doing it. Have I missed something terribly obvious?

TOPICS
SDK

Views

567

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 , Mar 25, 2017 Mar 25, 2017

Use LrExportSession() to export resized photos.  To construct the "exportSettings" table parameter, create and save an export preset in the UI.  Copy the settings from there, prefixing each key with "LR_", e.g. change "maxHeight" to "LR_maxHeight".

Votes

Translate

Translate
LEGEND ,
Mar 25, 2017 Mar 25, 2017

Copy link to clipboard

Copied

Use LrExportSession() to export resized photos.  To construct the "exportSettings" table parameter, create and save an export preset in the UI.  Copy the settings from there, prefixing each key with "LR_", e.g. change "maxHeight" to "LR_maxHeight".

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
Engaged ,
Mar 26, 2017 Mar 26, 2017

Copy link to clipboard

Copied

Thanks John.

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
Engaged ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

An addendum for those that might try this. Resizing using an Exportsession works but it's turning out to be impractical and I think I'm going to have to revert to ImageMagick. I'm creating 4 versions of each published image with between 30 & 120 images in each collection and the time & CPU overhead is pretty high. I'd imagine it has to do with each resize being performed on the full res RAW image and these are quite large (Sony, A7RII). ImageMagick I can generate resizes from each previous resize and it's a whole lot quicker. I can post the code, both versions, even,  if it's of interest to anyone.

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
LEGEND ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

It may not matter for your application, but using ImageMagick for the largest version of the image won't pick up any changes made in Develop.

Also, whether you're using Export or ImageMagick, you may well get significant speedups by using LrTasks.startAsyncTask() to run multiple exports/resizes in parallel. 

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
Engaged ,
Mar 29, 2017 Mar 29, 2017

Copy link to clipboard

Copied

LATEST

I mis-explained. I'm resizing the jpeg image generated for the publish service so picking up develop settings isn't an issue. I'm using ImageMagick's clone option, generating each subsequent downsize from the previous. It's between 3 & 4 times faster than using Lightroom and the memory overhead is less. I had to set a task count limit to stop asynctask calls running wild but otherwise I'm getting a significant speedup by resizing externally.

I'm using FTP to upload so I'm already running these in a task. Task count needs limiting, though, to prevent the server transfer limit being exceeded.

FWIW: this was an experiment in using FTP to publish images to Wordpress, as opposed to xmlrpc. It's faster and significantly more reliable.

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