mirror of
https://github.com/PR0M3TH3AN/Artstr-Studio.git
synced 2026-11-01 11:10:39 +00:00
JPEG export: DPI / quality selector
Small dropdown next to Export JPEG with three presets:
- 96 dpi / quality 0.85 — fast, screen-only
- 150 dpi / quality 0.92 — standard (default)
- 300 dpi / quality 0.95 — print-grade
The picker lives next to the existing Print/Save PDF + Export JPEG
buttons in the Print & Save panel. The click handler reads the
selected option and passes the right { dpi, quality } pair to
exportArtboardAsJpegBlob. No persisted state — defaults to standard
on each page load.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
1 parent
0cf8d05c1e
commit
88bd59bf12
1 file changed
+13
-1
+13
-1
@@ -2831,6 +2831,11 @@
|
||||
<div class="buttonRow" id="printExportRow">
|
||||
<button class="primary" id="printBtn">Print / Save PDF</button>
|
||||
<button id="exportJpegBtn">Export JPEG</button>
|
||||
<select id="exportJpegQuality" title="JPEG quality / resolution" style="flex:0 0 auto;width:auto">
|
||||
<option value="low">96 dpi</option>
|
||||
<option value="standard" selected>150 dpi</option>
|
||||
<option value="print">300 dpi</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="buttonRow" id="deckExportRow" style="display:none">
|
||||
<button type="button" class="primary" id="deckExportPdfBtn">Export deck as PDF</button>
|
||||
@@ -15495,9 +15500,16 @@
|
||||
const restoreBtn = (text) => { if (btn) { btn.disabled = false; if (text != null) btn.textContent = text; } };
|
||||
const prevText = btn?.textContent;
|
||||
if (btn) { btn.disabled = true; btn.textContent = 'Rendering…'; }
|
||||
// Resolution preset from the dropdown next to the button.
|
||||
const presetSel = document.getElementById('exportJpegQuality');
|
||||
const preset = presetSel?.value || 'standard';
|
||||
const opts =
|
||||
preset === 'low' ? { dpi: 96, quality: 0.85 } :
|
||||
preset === 'print' ? { dpi: 300, quality: 0.95 } :
|
||||
{ dpi: 150, quality: 0.92 };
|
||||
let result;
|
||||
try {
|
||||
result = await exportArtboardAsJpegBlob({ dpi: 150, quality: 0.92 });
|
||||
result = await exportArtboardAsJpegBlob(opts);
|
||||
} catch (e) {
|
||||
toastError && toastError('JPEG render failed — falling back to PDF flow.');
|
||||
restoreBtn(prevText);
|
||||
|
||||
Reference in new issue
Block a user