Add command line options for dpi change

Bug #1659489 reported by su_v
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
Mc
0.92.x
Fix Released
Wishlist
Mc

Bug Description

Inkscape 0.92.0 offers 3 (and current trunk even more) options to adjust legacy documents based on 90dpi to 96dpi if and as needed. All options aim to achieve the same result (preserving physical size if and as needed) using different internal methods (with varying success - none of the methods is 100% perfect, though adding or adjusting the viewBox can be considered the most stable one).

For batch-processing large repositories of Inkscape SVG files (e.g. to export to PDF|PS), it could be helpful to offer equivalent command line options for the available methods. This would also allow to suppress the dialog if for example Inkscape is used via GUI for a large set of similar files which require the same modification.

A possible solution could be:
   --change-dpi=[keep|viewbox|scale] with [default=keep]

An advanced feature could be to allow to save the file via command line as Inkscape SVG file based on the the chosen dpi change method - resorting to re-exporting as Plain SVG (-l, --export-plain-svg) is not a valid substitute due to loss of editor data.
   --export-inkscape-svg=FILENAME

Similarly, the feature to adjust baseline spacing of text in legacy files on load could be supported by:
   --fix-legacytext=[yes|no] with [default=yes]

Details may vary/depend on implementation and preferred names for the options.

Tags: cli
jazzynico (jazzynico)
Changed in inkscape:
importance: Undecided → Wishlist
milestone: none → 0.93
status: New → Triaged
Revision history for this message
su_v (suv-lp) wrote :

WIP status for lp:inkscape/0.92.x branch:

1) Inkscape 0.92.1pre0 includes a command line option to disable fixing baseline spacing of text in legacy documents:
   --do-not-fix-pre-92 Prevents automatic fix of pre-92 files on opening them.

   https://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/revision/15338

2) The latest patch (pending for 0.92.1pre1) in bug #1659229 includes:
   --do-not-fix-pre-92 Prevents automatic fix of pre-92 files on opening them.
   --dpi-update-method=[none|scale-viewbox|scale-document]
                         Method used to convert pre-.92 document dpi, if needed.

The command line options in (2) currently only support GUI mode (i.e. not yet to be combined with command line options that do not require the GUI). The patch needs to be "forward-ported" to trunk (if accepted for the stable release branch).

Revision history for this message
su_v (suv-lp) wrote :

On 2017-01-29 03:33 (+0100), Bryce Harrington wrote on the 'inkscape-devel' mailing list:
> Since both --do-not-fix-pre-92 and --dpi-update-method relate to
> the same underlying issue, I bet they could be sensibly combined
> into a single commandline option.
https://sourceforge.net/p/inkscape/mailman/message/35632831/

I do not agree to merge these two different command line options into a single one:
* Auto-fixing baseline spacing of text in legacy files is a [yes|no] decision. The default (and recommended) action is to always apply the fix when opening a file detected as "legacy". There might/will be (rare) cases where it is necessary to allow to disable these changes when opening a legacy file.
* Whether or not a file requires to be adapted for the interal 90->96 dpi change, and which internal method then should be used, depends on the individual file's content and use case (screen, output to device where physical size in absolute "real" units matters), and is not related to the issues with baseline spacing.
None of the factors to decide about the action with regard to document scale affect the decision whether or not to auto-fix baseline spacing.

The only common factor of the two options is that they concern legacy files. Otherwise, they are not related.

Revision history for this message
Bryce Harrington (bryce) wrote :

Ok I stand corrected, however it reinforces my point that --do-not-fix-pre-92 needs renamed. That is too easily confused with what the dpi update is doing (evidenced at least by the fact that I was confused by it.) I recommend something like --no-convert-text-baseline-spacing that will be exceedingly clear. I don't think the option itself needs to mention the file version; that is a detail that can be reserved to the help text.

Revision history for this message
Bryce Harrington (bryce) wrote :

`gimp --help` shows that the "--no-XXX" phrasing is an established convention for them.

Revision history for this message
Hachmann (marenhachmann) wrote :

Btw. the new command line command for not fixing baselines is missing in trunk, as far as I can see. New report?

Revision history for this message
su_v (suv-lp) wrote :

Hackmann wrote:
> the new command line command for not fixing baselines is
> missing in trunk

Cannot confirm: it was 'forward-ported' in rev 15481:
https://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/15481

$ inkscape -V
Inkscape 0.92+devel r15498
$ inkscape --help | grep text-baseline
      --no-convert-text-baseline-spacing Do not fix legacy (pre-0.92)

Revision history for this message
Hachmann (marenhachmann) wrote :

Mmh. Thank you, su_v - I didn't try it out, I only compared the files and couldn't find the command... must have overlooked. Sorry!

Mc (mc...)
Changed in inkscape:
status: Triaged → Fix Committed
status: Fix Committed → In Progress
assignee: nobody → Mc (mc...)
Revision history for this message
Mc (mc...) wrote :

fix ported to trunk r15729.

Changed in inkscape:
status: In Progress → Fix Committed
Revision history for this message
Hachmann (marenhachmann) wrote :

The dpi change commandline option isn't documented in the Inkscape man page yet (only in the Wiki release notes and here). Should it be?
https://gitlab.com/inkscape/inkscape/blob/0.92.x/man/inkscape.pod.in

Max Gaukler (mgmax)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.