eschutho commented on PR #39285:
URL: https://github.com/apache/superset/pull/39285#issuecomment-4665610390

   ## QA Test: Image Download at 2× Scale — Commit `04388ebc42`
   
   **Tested:** "Overall Sales (By Product Line)" — Pie/Donut chart (ECharts)
   **Environment:** Superset running via `docker-compose-light.yml`, headless 
Chromium (Playwright), `deviceScaleFactor=1`
   
   ### Results
   
   | Metric | Value |
   |---|---|
   | **Downloaded image dimensions** | **2534 × 1606 pixels** |
   | **File size** | 90.3 KB |
   | **Scale factor** | 2× (chart container is ~1267×803 CSS px) |
   | **Format** | JPEG (quality 0.95) |
   | **Labels readable?** | ✅ Yes — all 7 labels are crisp and sharp |
   
   ### Downloaded image (2534×1606)
   
   ![Downloaded pie chart at 
2x](https://raw.githubusercontent.com/eschutho/superset/image-download-scale-pr/qa-evidence/downloaded-pie-chart-2x.jpg)
   
   All labels — "Classic Cars", "Vintage Cars", "Motorcycles", "Trucks and 
Buses", "Planes", "Ships", "Trains" — are clearly readable with clean 
anti-aliasing. No blurriness. Leader lines are clean single-pixel lines.
   
   ### Browser view before download
   
   ![Browser 
view](https://raw.githubusercontent.com/eschutho/superset/image-download-scale-pr/qa-evidence/browser-view-before-download.png)
   
   ### How the new approach works
   
   The code uses `instance.getDataURL({ pixelRatio: IMAGE_DOWNLOAD_SCALE, type: 
'png', backgroundColor: 'transparent' })` to render ECharts off-screen at 2× 
resolution. The high-res PNG is placed as an `<img>` inside the clone so 
dom-to-image picks up the sharp pixels. No `window.devicePixelRatio` spoofing, 
no `resize()` call, no canvas mutation.
   
   ### Verdict
   
   ✅ **The `getDataURL` approach produces crisp, high-resolution labels.** The 
downloaded image is 2× the chart's CSS dimensions, and all text/labels are 
sharp and readable.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to