From 2aefa2246ccd07b676191ad1f46f258d04f2f20b Mon Sep 17 00:00:00 2001 From: Agnes Chang Date: Mon, 1 Jul 2024 13:03:59 +0900 Subject: [PATCH] Handle :jpg image fmt for separate img layers --- ai2html.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ai2html.js b/ai2html.js index ac9186f..31bc8e3 100644 --- a/ai2html.js +++ b/ai2html.js @@ -3610,6 +3610,16 @@ function convertArtItems(activeArtboard, textFrames, masks, settings) { } hiddenLayers.push(lyr); // need to unhide this layer later, after base image is captured }); + // Also embed layers tagged :jpg as separate images + forEachImageLayer('jpg', function(lyr) { + var name = getLayerImageName(lyr, activeArtboard, settings); + // Same test as :png to prevent empty images (see above) + if (testLayerArtboardIntersection(lyr, activeArtboard)) { + html = exportImage(name, 'jpg', activeArtboard, null, null, settings) + html; + } + hiddenLayers.push(lyr); // need to unhide this layer later, after base image is captured + }); + // placing ab image before other elements html = captureArtboardImage(imgName, activeArtboard, masks, settings) + html; // unhide hidden layers (if any)