First failed product package. Zip had files. No cover. Marketplace search page showed gray square with filename. Looked broken. Buyers scroll past broken.
Why two images exist
Marketplaces show two contexts. Search grid shows thumbnail. Product page shows cover. Sizes differ. 600x600 fits grid tile. 1280x720 fits page header, same ratio as YouTube thumbnail, same ratio Adobe Stock preview uses.
One image cannot serve both. 1280x720 squashed into 600x600 grid tile loses sides. Text unreadable. 600x600 stretched to 1280x720 blurs. Blurry cover signals low quality before click.
So pack_product.py renders both. Same title, same palette, different canvas.
The exact output
Run:
python pack_product.py my-product "My Product" "A short subtitle" 9 Writes three files into _system folder:
- my-product.zip
- my-product-cover.jpg (1280x720)
- my-product-thumb.jpg (600x600)
Pillow does the rendering. Only third-party dependency in that script. reportlab handles PDFs in md2pdf.py. Everything else in the kit uses Python standard library.
Why not crop one from the other
Naive approach: render 1280x720, crop center to 600x600. Saves one render call. Loses control.
Title placement differs. Cover title sits lower third, leaves room for hero art above. Thumbnail title must center. Grid tile small. Text near edge clips on rounded-corner tile masks some marketplaces apply.
Separate renders mean separate layouts. Thumbnail gets bigger relative font, fewer words. Cover gets subtitle. Thumbnail drops subtitle. Subtitle unreadable at 200px wide.
Code checks canvas size, picks font scale accordingly, draws each from scratch.
The RAM constraint forces this
Server runs 1 vCPU, 2 GB RAM, no GPU. Cannot hold multiple full-res renders in memory.
pack_product.py renders cover, frees memory, renders thumbnail, frees memory. One canvas at a time. gc.collect() between assets when batching.
Measure peak RSS with resource.getrusage(RUSAGE_SELF).ru_maxrss. Never average. Average hides the spike that kills the process.
39 products packaged this way. 856 MB output. No OOM kill.
Metadata matches the images
make_metadata.py writes Adobe 5-column header, Vecteezy 4-column, Dreamstime 15-column. Exact headers, nothing else. Wrong header = instant reject before human review sees anything.
Cover and thumbnail filenames derive from product slug. Metadata CSV references same slug. upload_tracker.py ledger remembers what shipped. Re-run batch cannot double-post.
Double-post is fastest flag trigger on stock platforms. Ledger makes it impossible.
What the full pipeline does
Four scripts are packaging layer. Full digital asset factory sits above: Hermes Agent orchestrates jobs, retries failures, costs $0. 9Router proxies LLM access locally. Prompt engine feeds both. ~19,000 lines of pipeline code, 300+ pages of research behind platform rules.
Result: 1,860 assets made, 1,077 ready or submitted. First paid sale: $2.80. Small number. Real number.
The kit is the exact packaging scripts extracted from that pipeline. Not a tutorial. Working tools.
Building digital products? Free guides & kits for digital product sellers.