[pdfx] Align default image format with native implementation (JPEG → PNG) - #581
[pdfx] Align default image format with native implementation (JPEG → PNG)#581ktanaka101 wants to merge 3 commits into
Conversation
The public docs—and the native Android / iOS layers—treat PNG as the default output format when `format` is omitted, but the Dart signature still defaulted to `PdfPageImageFormat.jpeg`.
|
Thanks for the PR and the detailed writeup. Digging into the native implementations before merging, I want to flag something: this isn't actually a no-op default change. Both Android ( So switching the default to PNG is a genuine behavior change for anyone relying on the implicit default: larger output, lossless, alpha-preserving instead of JPEG's lossy compression. That's likely fine, arguably PNG is the better default given format aligns with the docs, but we'd want to merge it as an explicit behavior change with its own CHANGELOG entry, not as a docs/lint alignment fix. Can you confirm you still want PNG as the new default with that understanding? If so we'll merge and call it out clearly in the release notes. |
Description
What & Why
Both the public docs and the native Android / iOS layers say
PdfPage.render()defaults to PNG whenformatis omitted.The Dart signature, however, still defaulted to
PdfPageImageFormat.jpeg.That mismatch triggers a false-positive from the
avoid_redundant_argument_valueslinter: it tells you to drop the argument, but doing so would silently
change the result from JPEG → PNG.
This PR aligns the Dart default with reality:
Tests
Added
test/pdfx_test.dart.Impact
Thanks for reviewing!