Skip to content

Commit

Permalink
Merge pull request #122 from hugoblanc/master
Browse files Browse the repository at this point in the history
docs: add image magick config helper
  • Loading branch information
w3nl authored Dec 17, 2024
2 parents 443161b + 794dc66 commit 1dfaa17
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ppt-png

Convert ppt to image (png,jpg).

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-stats] [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=w3nl_ppt-png&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=w3nl_ppt-png) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=w3nl_ppt-png&metric=bugs)](https://sonarcloud.io/summary/new_code?id=w3nl_ppt-png) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=w3nl_ppt-png&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=w3nl_ppt-png) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=w3nl_ppt-png&metric=coverage)](https://sonarcloud.io/summary/new_code?id=w3nl_ppt-png)
Expand All @@ -9,9 +10,9 @@ If you want convert powerpoint files to png or jpg images, you can do it with th

The package requires the following software to be installed:

* LibreOffice-dev
* ImageMagick
* pdfinfo
- LibreOffice-dev
- ImageMagick
- pdfinfo

## Installation

Expand All @@ -27,7 +28,6 @@ Mac:

`brew install imagemagick poppler ghostscript`


## Basic Usage (node.js)

```
Expand All @@ -45,7 +45,20 @@ files: Array with the files.

output: Output folder.

## ImageMagick settings

Image Magick can crash with segmentation fault (core dumped) or other errors. If you have more memory available, you can increase the memory default limits.

```Dockerfile
# Configure ImageMagick for PDF conversion with increased memory limits
RUN if [ -f /etc/ImageMagick-6/policy.xml ]; then \
sed -i 's/<policy domain="resource" name="memory" value="256MiB"\/>/<policy domain="resource" name="memory" value="2GiB"\/>/g' /etc/ImageMagick-6/policy.xml && \
sed -i 's/<policy domain="resource" name="disk" value="1GiB"\/>/<policy domain="resource" name="disk" value="4GiB"\/>/g' /etc/ImageMagick-6/policy.xml; \
fi
```

### Todo:

invert: Invert the colors, default is `false`;

greyscale: Greyscale the colors, default is `false`;
Expand All @@ -64,7 +77,6 @@ height: Height of the output images if density is not used

logLevel: Set the log level, default is `1`.


## Test the package.

```
Expand All @@ -79,7 +91,6 @@ If you only want to check the eslint rules, just run.
npm run lint
```


[downloads-image]: https://img.shields.io/npm/dm/ppt-png.svg
[npm-url]: https://www.npmjs.com/package/ppt-png
[npm-image]: https://img.shields.io/npm/v/ppt-png.svg
Expand Down

0 comments on commit 1dfaa17

Please sign in to comment.