OnlineFreeTools.org
  • Home
  • Tools
    Health & body →
    BMI Calculator — How to Calculate Body Mass IndexBMR & TDEE Calculator — How to Calculate Daily CaloriesBody Fat Calculator — How to Estimate Body Fat PercentageHeart Rate Zone CalculatorIdeal Weight Calculator — How to Estimate Ideal Body WeightMacro Calculator — Calories to Protein Carb Fat GramsOne-Rep Max Calculator (Epley)Pace Calculator — min/km and Speed
    Personal money →
    CAGR Calculator — How to Calculate Compound Annual Growth RateCompound Interest Calculator — How to Calculate Future ValueDebt Payoff Calculator — Months to Clear a BalanceDiscount Calculator — How to Calculate Sale PriceEMI Calculator — How to Calculate Loan PaymentsInflation Calculator — Future Purchasing PowerPercentage Change Calculator — From Old Value to NewPresent Value Calculator — PV and FV ModesRule of 72 Calculator — Years to DoubleSalary to Hourly Calculator — How to Convert Pay RatesTip Calculator — Tip Amount and SplitVAT / GST Calculator — Add or Extract Tax
    Business finance →
    Create a budget spreadsheetCreate an Excel timesheetCreate an invoice spreadsheetBreak-Even Calculator — How to Calculate Break-Even PointContribution Margin Calculator — Price Minus Variable CostGross Margin Calculator — How to Calculate Gross MarginIRR Calculator — Internal Rate of ReturnHow to Calculate Marginal Revenue — MR Calculator (ΔTR / ΔQ)Markup Calculator — How to Calculate Markup PercentageHow to Calculate NPV — Net Present Value CalculatorPayback Period Calculator — Years to Recover InvestmentProfit Margin Calculator — Net or Operating MarginROI Calculator — How to Calculate Return on Investment
    Math & stats →
    Confidence Interval Calculator — How to Calculate a CIExponent Calculator — How to Calculate PowersGPA Calculator — How to Calculate Weighted GPALogarithm Calculator — How to Calculate LogsMean Calculator — Average of a Number ListMedian and Mode CalculatorP-Value Calculator — How to Calculate a P-ValuePermutation and Combination CalculatorQuadratic Equation Solver — Roots and DiscriminantSample Size Calculator — How to Estimate Required nScientific Notation Calculator — How to Convert Scientific NotationSignificant Figures Calculator — How to Count and Round Sig FigsStandard Deviation Calculator — How to Calculate SD and VarianceZ-Score Calculator — How to Calculate a Standard Score
    Geometry & measure →
    Aspect Ratio Calculator — How to Calculate and Scale RatiosCircle Calculator — Area and CircumferenceGradient Calculator — Multivariable ∇f (Partial Derivatives)Pythagorean Theorem Calculator — How to Find a Missing SideSlope Calculator — How to Calculate Slope Between Two PointsTriangle Area CalculatorVolume Calculator — Box and SphereUnit Converter — Length / Mass / Temperature / Area / Volume / Speed
    Science & physics →
    Acceleration Calculator — Change in VelocityDensity Calculator — Mass over VolumeOhm’s Law Calculator — Resistance and PowerVelocity Calculator — Distance over TimeMeasuring Magnetic Fields — Field strength calculator
    Home & DIY →
    Concrete Calculator — How to Estimate Concrete VolumePaint Calculator — How to Estimate Paint NeededTile Calculator — How to Estimate Tile QuantitySquare Feet to Square Meters — Area Converter for Homes & Renovation
    Time & calendar →
    Age Calculator — Chronological Age from BirthdateDate Difference Calculator — Days and WeeksTime Zone Converter — Compare One Moment WorldwideUnix Timestamp Converter — Epoch ↔ Readable Time
    PDF & docs →
    Add a visible integrity mark to a PDFAdd text to a PDF fileBatch compress PDFs for emailInspect PDF/A indicatorsCombine files into one PDFCompare two PDFsReduce PDF file sizeConvert HTML to PDFExport PDF text to DXF for AutoCADConvert PDF to PDF/AConvert Word document to PDFCreate a PDF formCrop PDF — Trim Page Margins in Your BrowserEdit PDF form fieldsEdit PDF text onlineExtract text from a PDFFill out a PDF formMake a PDF fillableMake a PDF flipbookCombine PDF files into oneOpen a PDF in the browserOrganize PDF — Reorder or Remove Pages in Your BrowserAdd Page Numbers to PDF — In Your BrowserPDF Page to Image Sizes — Multi-Size Export PackConvert PDF pages to JPGPDF to Markdown — Extract Text for Notes in Your BrowserPDF Watermark — Stamp Text on Every Page in Your BrowserPrint a PDFPassword-protect a PDFRotate PDF — Fix Page Orientation in Your BrowserSign a PDF documentSplit my PDFTurn PDF into an editable text documentTurn PDF into Word documentUnlock my PDFWrite a PDF document online
    Image & media →
    Add Text Watermark to Photo — Local Browser ToolAmazon main image sizeApple-touch-icon 180×180Batch watermark product photosBulk compress PNG imagesBulk compress product photos (JPEG, PNG, WebP)Bulk convert images to JPGBulk convert images to PNGBulk convert images to WebPExtract Colors from Image — Palette & Click PickFlip Image — Mirror Horizontally or VerticallyAdd Border to Image — Color & Width OnlineImage Compressor — Shrink photos on your deviceCrop & Resize Image — Local Aspect PresetsPhoto EXIF Viewer & Remover — GPS, Camera & Local StripImage Format Converter — PNG JPEG WebP AVIF BMP GIF ICO SVGConvert Image to Grayscale — Black & White OnlineMerge Images — Combine Photos into One CollageImage Optimizer — Smaller files with on-device encodersOverlay Images — Put a Logo on a PhotoImage to Base64 Converter — Encode & Decode LocallyImages to GIF — Make an Animated GIF LocallyTurn JPG into PDFImages to PowerPoint — Photos to PPTX SlidesImages to Word — Build a DOCX from PhotosInstagram post sizeInstagram story sizeiOS app icon sizeiPhone 6.9 screenshot sizeLinkedIn banner sizeOpen Graph image sizeSVG optimizerYouTube thumbnail size
    Design & brand →
    Generate Brand Color Scale — 50–950 Palette & CSS TokensBrand Style Guide — Generate a Modular Draft You Can EditSmart Website Color Scheme — Semantic CSS TokensWCAG Contrast Checker — AA/AAA Ratio Online
    SEO & growth →
    Check if a URL is blocked by robots.txtCheck SSL certificate expirationtool_cwv_titleFind and validate XML sitemaptool_hreflang_titleIndexNow — Submit URLs to Bing without waiting for crawltool_serp_titletool_meta_titletool_onpage_titletool_og_titletool_robots_titletool_schema_titletool_sitemap_titleSPF DKIM DMARC checkertool_utm_titleValidate security.txt
    Network & IP →
    Add WWW to DNS — Point www at your apex domainAWS VPC CIDR planner — Split a VPC into AZ subnetsCIDR cheat sheet — Click a prefix to see mask and hostsCIDR to IP range — Expand a prefix into usable addressesDomain Lookup — Check DNS Records & Registration OnlineWhat Is My IP Address — See Your Public IP (IPv4 or IPv6)IP range to CIDR — Turn start–end addresses into prefix listsIPv6 CIDR calculator — Expand a prefix into its address rangePrivate CIDR ranges — Check if an IP or prefix is private or special-useTerraform cidrsubnet — Get the child CIDR Terraform would returntool_headers_title
    Dev & data →
    Base64 Encode & Decode — Convert Text in Your BrowserChatGPT export to MarkdownCSV ↔ JSON Converter — Convert tables in your browsercurl to fetchCopy common Excel formulasHTML Entity Encoder & Decoder — Escape, Unescape & LocalJSON Schema Validator — See path errors on your deviceJWT Decoder — Read Header & Payload Locally (No Verify)tool_markdown_titleWrap a formula with IFNAWrite a COUNTIF formula in ExcelWrite an IFS formula in ExcelWrite a nested IF formula for ExcelYAML ↔ JSON Converter — Convert configs in your browser
    AI prompt tools →
    Android prompt builder — Local + Optional AIFilm prompt builder — Local + Optional AIiOS prompt builder — Local + Optional AIMidjourney prompt builder — Local + Optional AIProduct design prompt builder — Local + Optional AIPrompt template builder — Local + Optional AIShort drama prompt generator — Local + Optional AISketch.app prompt generator — Local + Optional AIWriting prompt generator — Local + Optional AI
    Text compare →
    Compare two text files onlineCompare two Word documents for differencesExcel compare filesJSON diff checker onlineCheck difference between two texts
    Security & IDs →
    Batch checksum release filesFile Hash Checker — Verify Digests in Your BrowserFile metadata analyzerRandom Password Generator — Create Passwords LocallyUUID & ULID Generator — Create IDs in Your Browser
    Files & archives →
    Archive Extractor Online — Open Compressed Files in Your BrowserCreate zip fileMagnet Link Decoder — Parse Info Hash and Trackers LocallyUnzip File Online — Extract ZIP Files in Your Browser
  • Tool topics
  • Tool types
  • Dev Logs
☕ Buy me a coffee

Navigation

Home

Split Compress all onto its own highlighted row, put each option category on a separate line with a None choice (now the first-paint default), stopped auto-filling the sample, and made selected option chips a teal filled state that beats the site outline-button CSS. | Dev Logs

Back to Logs

Date: 2026-09-06 21:35 Summary: Split Compress all onto its own highlighted row, put each option category on a separate line with a None choice (now the first-paint default), stopped auto-filling the sample, and made selected option chips a teal filled state that beats the site outline-button CSS. Visibility: people

[question] https://onlinefreetools.org/tools/bulk-compress-product-photos 1、Compress ALL第一行,要单独一行,突出显示。后续都是选项,要区分开来。2、不同类别选择项,要单独一行,且都提供不选择的选项。3、剔除提前填充的example

Tool links (English)

  • https://onlinefreetools.org/tools/bulk-compress-product-photos Chinese: https://onlinefreetools.org/zh/tools/bulk-compress-product-photos

[try to solve]

Context

The bulk product-photo compressor mixed the primary action with shortcut chips on one wrapping toolbar. Format chips (.jpg / JPEG / WebP / PNG) sat next to size-cap chips (200 KB / 100 KB) and the Compress all button, so the main job was easy to miss. A second flex row then piled output format, resize, size rule, pixels, and quality together. Opening the page also synthesized two sample JPEGs and ran compressAll() immediately, which filled the results table before the visitor had chosen any files.

The request was three UI changes on that page: put Compress all first and alone, make each option category a separate row with a true “none” choice, and stop pre-filling the example.

Process

The page source is src/pages/bulkCompressProductPhotosPage.ts. The old toolbar was a single tools-bar of buttons; presets lived in one <select> with three optgroups (listing scenes, size-only, KB-only). Hidden behind that, probeAll().then(loadSample) always queued two canvas JPEGs.

The new layout, after the dropzone, is:

  1. Action row — Compress all as a larger primary button (bcp-action-row), not btn-sm.
  2. Format row — None (keep each file’s jpeg/webp/png, otherwise fall back to JPEG) · JPEG (.jpg) · WebP · PNG.
  3. Target size row — None (no KB search) · 500 / 200 / 100 / 50 / 30 KB, plus a number field when a cap is on.
  4. Size rule row — None (do not downscale) · longest side / max width / max height · px input · a pixel shortcut select that also starts with None.
  5. Listing preset row — None, then the scene presets only (HD / listing / email / social / thumb / tiny).
  6. Quality row and JPEG background row.
  7. Secondary actions — Download ZIP, Load sample, Clear, visually quieter under a dashed rule.

Chip groups are Bootstrap btn-check radios so “none” and a real value are exclusive. Hidden #bcpOutput / #bcpResizeOn / #bcpTargetOn / #bcpSizeRule keep the existing encode pipeline. mimeForFile() uses the selected format when one is set; empty format keeps the source MIME. loadSample() remains for the button and for lint:tool-page; init only calls probeAll() then syncOptionsUi().

Copy that claimed “the sample already ran on first paint” was updated in all ten locale shards (description, how_item_5), and opt_none was added (English “None”, Chinese “不选择”, and matching short labels in the other locales).

Root cause / analysis

The first-row confusion was layout, not missing features: Compress all was one btn-sm among chips. Categories were mixed because chips were treated as a single toolbar rather than radio groups. Auto-sample is required by tool-creation.mdc for most new tools, but an explicit product request to stop pre-filling wins over that default; keeping the Load sample button still satisfies the loadSample HTML gate.

“None” is now the first-paint default for format, KB, size rule, and JPEG fill. JPEG / 200 KB / longest-side remain available chips so a listing batch still works in two clicks. Quality stays at 0.8 because it is a slider, not a chip.

Solution

After merge:tools / build:site, prerendered English HTML has bcp-action-row first, then format / KB / size none chips, and probeAll().then no longer calls loadSample. Chinese HTML contains “全部压缩” and “不选择”. npm run lint:tool-page -- --slug=bulk-compress-product-photos --require-html and lint:seo passed. verify:tool isolation reported unrelated dirty files (open-graph-preview), not this slug’s shards.

Load sample still builds two stand-in listing JPEGs and compresses them when clicked. Files still never leave the tab.

Review follow-up: “JPEG background” was a format-named control for an alpha-flattening step. JPEG has no transparency, so a matte is only needed when writing JPEG from pixels that may be empty. The row is now Fill transparent pixels, shown only when output is JPEG, with None (no matte). PNG/WebP keep alpha. Picking a KB cap no longer silently switches PNG to WebP/JPEG. .jpg and JPEG chips were the same encode and are merged to JPEG (.jpg).

A follow-up asked for a clearer selected button. The first fill used #292931 on .btn-check:checked + .btn, but site.css still wins on .btn-outline-secondary (background: #ffffff !important, and hover/focus reset to white). Selected chips therefore looked almost the same as idle chips.

The reliable selected state is now:

  1. Every option label gets bcp-chip. Compress all / ZIP / Sample / Clear stay ordinary buttons.
  2. Default-checked labels also ship with bcp-chip-on in the HTML so first paint is already filled. After the later request to start on None, those classes sit on the None chips (format, KB, size, fill), not JPEG / 200 KB / longest side / White.
  3. syncChipLooks() runs from syncOptionsUi() and toggles bcp-chip-on from the matching radio’s checked.
  4. Page CSS under #content .tool-panel .bcp-opt-row uses brand teal (--brand #0f6e8c), white type, 2px border, and a 3px ring, all !important, so it beats the site outline rule. Listing and pixel <select>s keep bcp-select-on when the value is not None.

Prerendered English HTML shows bcp-chip-on on the None chips. lint:tool-page --require-html passed after slug prerender + gzip.

A later request set every option row to None on first paint: keep each file’s jpeg/webp/png, skip resize, skip the KB search, hide fill-until JPEG is picked. Copy in all ten locales no longer says the 200 KB chip is already on. Load sample follows the current chips.

A later request: clicking Compress all now clears the yellow warning first, so the PNG+KB hint is not glued onto “PNG output often stays large” from the same run. Switching off PNG or the KB chip also drops that specific hint.

Notes / boundaries

  • JPEG (.jpg) is one chip: .jpg and JPEG were the same encode (image/jpeg).
  • Fill transparent pixels includes None (skip the matte). The row is JPEG-only because PNG/WebP keep alpha.
  • Local wrangler was not running for a click-through in this pass; selected classes and CSS were checked on public/_pages/en/tools/bulk-compress-product-photos.html. Production still needs deploy (or start:dev / local R2 upload) to show the new look.

[actions]

  • src/pages/bulkCompressProductPhotosPage.ts — action row, per-category option rows with None, keep-original MIME, no auto sample; selected chips use bcp-chip / bcp-chip-on; Compress all clears leftover PNG/KB yellow warnings before this batch writes new ones
  • src/site/i18n/tools/bulk-compress-product-photos/{en,zh,de,fr,es,ja,id,pt,ru,ar}.ts — opt_none plus first-paint copy
  • src/site/tool-catalog.d/bulk-compress-product-photos.json — updatedAt via tool:touch
  • work-tasks/bulk-compress-product-photos/02-tool-info.md — sample spec matches “button only”
  • npm run verify:tool -- --slug=bulk-compress-product-photos (isolation noise from other dirty files)
OnlineFreeTools.org · Learning project · Iterating
About·Privacy·Terms·Contact·GitHub