From ac87eea3174a67f03b553b7b754af6d674ea9fc7 Mon Sep 17 00:00:00 2001 From: DarthSim Date: Tue, 30 May 2023 20:08:04 +0300 Subject: [PATCH] Update changelog and docs --- CHANGELOG.md | 4 ++++ docs/configuration.md | 1 + docs/generating_the_url.md | 12 ++++++++++++ docs/getting_the_image_info.md | 11 +++++++++++ 4 files changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85e8fe68..06ae16f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ ## [Unreleased] ### Add - Add `IMGPROXY_URL_REPLACEMENTS` config. +- (pro) Add `IMGPROXY_STRIP_METADATA_DPI` config. +- (pro) Add [dpi](https://docs.imgproxy.net/latest/configuration?id=dpi) processing option. +- (pro) Add WebP EXIF and XMP to the `/info` response. +- (pro) Add Photoshop resolution data to the `/info` response. ### Change - Preserve GIF's bit-per-sample. diff --git a/docs/configuration.md b/docs/configuration.md index 0d3bcb71..9515e5f4 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -541,6 +541,7 @@ imgproxy can send logs to syslog, but this feature is disabled by default. To en * `IMGPROXY_DISABLE_SHRINK_ON_LOAD`: when `true`, disables shrink-on-load for JPEGs and WebP files. Allows processing the entire image in linear colorspace but dramatically slows down resizing and increases memory usage when working with large images. * `IMGPROXY_STRIP_METADATA`: when `true`, imgproxy will strip all metadata (EXIF, IPTC, etc.) from JPEG and WebP output images. Default: `true` * `IMGPROXY_KEEP_COPYRIGHT`: when `true`, imgproxy will not remove copyright info while stripping metadata. Default: `true` +* `IMGPROXY_STRIP_METADATA_DPI`: ![pro](./assets/pro.svg) the DPI metadata value that should be set for the image when its metadata is stripped. Default: `72.0` * `IMGPROXY_STRIP_COLOR_PROFILE`: when `true`, imgproxy will transform the embedded color profile (ICC) to sRGB and remove it from the image. Otherwise, imgproxy will try to keep it as is. Default: `true` * `IMGPROXY_AUTO_ROTATE`: when `true`, imgproxy will automatically rotate images based on the EXIF Orientation parameter (if available in the image meta data). The orientation tag will be removed from the image in all cases. Default: `true` * `IMGPROXY_ENFORCE_THUMBNAIL`: when `true` and the source image has an embedded thumbnail, imgproxy will always use the embedded thumbnail instead of the main image. Currently, only thumbnails embedded in `heic` and `avif` are supported. Default: `false` diff --git a/docs/generating_the_url.md b/docs/generating_the_url.md index 8cb4752c..1f9d7a62 100644 --- a/docs/generating_the_url.md +++ b/docs/generating_the_url.md @@ -552,6 +552,18 @@ kcr:%keep_copyright When set to `1`, `t` or `true`, imgproxy will not remove copyright info while stripping metadata. This is normally controlled by the [IMGPROXY_KEEP_COPYRIGHT](configuration.md#miscellaneous) configuration but this procesing option allows the configuration to be set for each request. +### DPI![pro](./assets/pro.svg) :id=dpi + +``` +dpi:%dpi +``` + +When set, imgproxy will replace the image's DPI metadata with the provided value. When set to `0`, imgproxy won't change the image's DPI or will reset it to the default value if the image's metadata should be stripped. + +**📝 Note:** This processing option takes effect whether imgproxy should strip the image's metadata or not. + +Default: `0` + ### Strip color profile ``` diff --git a/docs/getting_the_image_info.md b/docs/getting_the_image_info.md index ccabbfa2..5d992d7c 100644 --- a/docs/getting_the_image_info.md +++ b/docs/getting_the_image_info.md @@ -55,6 +55,7 @@ imgproxy responses with a JSON body and returns the following info: * `exif`: Exif data * `iptc`: IPTC data * `xmp`: XMP data +* `photoshop`: Photoshop metadata (currently, only the resolution data) * `video_meta`: metadata from the video **📝 Note:** There are lots of IPTC tags in the spec, but imgproxy supports only a few of them. If you need some tags to be supported, just contact us. @@ -98,6 +99,16 @@ imgproxy responses with a JSON body and returns the following info: "photoshop": { "DateCreated": "2016-09-11T18:44:50.003" } + }, + "photoshop": { + "resolution": { + "XResolution": 240, + "XResolutionUnit": "inches", + "WidthUnit": "inches", + "YResolution": 240, + "YResolutionUnit": "inches", + "HeightUnit": "inches" + } } } ```