feat: the proof samples the file's colours too, up to 30 cm (Marcus, 2026-11-26)
Some checks failed
Some checks failed
The proof keeps its 15 cm window on the finest stroke and adds 5 cm samples of the colours that window lacks (12 hues, grey, white, black), 1 cm of clear film between them, up to 30 cm. The colours are read from the small picture the Site sends of each file, so a long film is scanned in a moment; without pictures (a proof cut from a prepared final) it stays the stroke window. #100's proof caught only its white art. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -211,6 +211,12 @@ def render_one(storage):
|
||||
job['proof_fallback'] = True
|
||||
elif needs_designer(job['snapshot']):
|
||||
job['wait_for_treatment'] = True
|
||||
# The small pictures the Site sent of each file: where a proof finds
|
||||
# the colours to sample (app/printpng.py film_scan).
|
||||
if job['snapshot'].get('proof_of') and not job.get('proof_fallback'):
|
||||
job['pictures'] = {str(r['upload_id']): bytes(r['data']) for r in c.execute(
|
||||
'SELECT upload_id,data FROM dtf_local.upload_thumbnails WHERE upload_id=ANY(%s)',
|
||||
(source_ids,)).fetchall()}
|
||||
uploads = c.execute('''SELECT id,name,size,object_key,scan_state,purged_at,expires_at,
|
||||
(expires_at<=now()) AS expired FROM dtf_local.uploads WHERE id=ANY(%s)''',
|
||||
(source_ids,)).fetchall()
|
||||
@@ -344,6 +350,15 @@ def footer(job, item):
|
||||
return ' · '.join(fields)
|
||||
|
||||
|
||||
def pictures_by_source(item, pictures):
|
||||
"""The small pictures by source index, as the proof's scan reads them."""
|
||||
if not pictures:
|
||||
return None
|
||||
sources = item['production']['sources']
|
||||
found = {i: pictures[str(s['upload_id'])] for i, s in enumerate(sources) if str(s['upload_id']) in pictures}
|
||||
return found or None
|
||||
|
||||
|
||||
def produce(storage, job, item, uploads):
|
||||
"""Fetch the item's artwork and render it. Returns (folder, [(png path,
|
||||
name)], evidence); the caller removes the folder."""
|
||||
@@ -389,7 +404,8 @@ def produce(storage, job, item, uploads):
|
||||
else file_prefix(job['number'], job['item_index']))
|
||||
parts, detail = render(item, files, output, prefix, footer=footer(job, item), tiles=True,
|
||||
limit_cm=PROOF_SHEET_CM if proof_of else None,
|
||||
proof_fraction=item.get('proof_y_fraction') if proof_of else None)
|
||||
proof_fraction=item.get('proof_y_fraction') if proof_of else None,
|
||||
pictures=pictures_by_source(item, job.get('pictures')))
|
||||
except BaseException:
|
||||
shutil.rmtree(output, ignore_errors=True)
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user