Skip to content

Adjust default image scale for PPTX from 2.5 to 2 #385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- Update Dock icon in preview mode on macOS to suit for Big Sur ([#380](https://github.com/marp-team/marp-cli/pull/380))
- Update an icon of presenter view in bespoke template ([#384](https://github.com/marp-team/marp-cli/pull/384))
- Adjust default image scale for PPTX from `2.5` to `2` ([#385](https://github.com/marp-team/marp-cli/pull/385))

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ marp slide-deck.md -o [email protected] --image-scale 2

> :information_source: `--image-scale` is not affect to the actual size of presentation.
>
> It is also available for PPTX conversion. By default, Marp CLI will use `2.5` as the default scale factor in PPTX to suppress deterioration of slide rendering in full-screen presentation.
> It is also available for PPTX conversion. By default, Marp CLI will use `2` as the default scale factor in PPTX to suppress deterioration of slide rendering in full-screen presentation.

### Security about local files

Expand Down Expand Up @@ -462,7 +462,7 @@ If you want to prevent looking up a configuration file, you can pass `--no-confi
| `html` | boolean \| object | `--html` | Enable or disable HTML tags (Configuration file can pass [the whitelist object] if you are using Marp Core) |
| `image` | `png` \| `jpeg` | `--image` | Convert the first slide page into an image file |
| `images` | `png` \| `jpeg` | `--images` | Convert slide deck into multiple image files |
| `imageScale` | number | `--image-scale` | The scale factor for rendered images (`1` by default, or `2.5` for PPTX conversion) |
| `imageScale` | number | `--image-scale` | The scale factor for rendered images (`1` by default, or `2` for PPTX conversion) |
| `inputDir` | string | `--input-dir` `-I` | The base directory to find markdown and theme CSS |
| `jpegQuality` | number | `--jpeg-quality` | Setting JPEG image quality (`85` by default) |
| `keywords` | string \| string[] | `--keywords` | Define keywords for the slide deck (Accepts comma-separated string and array of string) |
Expand Down
2 changes: 1 addition & 1 deletion src/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export class Converter {
template = await useTemplate(true)
files.push(
await this.convertFileToPPTX(template, file, {
scale: this.options.imageScale ?? 2.5,
scale: this.options.imageScale ?? 2,
})
)
break
Expand Down
2 changes: 1 addition & 1 deletion src/marp-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const marpCli = async (
type: 'string',
},
'image-scale': {
defaultDescription: '1 (or 2.5 for PPTX conversion)',
defaultDescription: '1 (or 2 for PPTX conversion)',
describe: 'The scale factor for rendered images',
group: OptionGroup.Converter,
type: 'number',
Expand Down
4 changes: 2 additions & 2 deletions test/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,9 @@ describe('Converter', () => {
expect(write).toHaveBeenCalled()
expect(write.mock.calls[0][0]).toBe('test.pptx')

// It has a different default scale x2.5
// It has a different default scale x2
expect(setViewport).toHaveBeenCalledWith(
expect.objectContaining({ deviceScaleFactor: 2.5 })
expect.objectContaining({ deviceScaleFactor: 2 })
)

// ZIP PK header for Office Open XML
Expand Down