Sfoglia il codice sorgente

Reset image resolution while stripping meta

DarthSim 3 anni fa
parent
commit
016258f7eb
2 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. 2 0
      CHANGELOG.md
  2. 8 1
      vips.c

+ 2 - 0
CHANGELOG.md

@@ -1,6 +1,8 @@
 # Changelog
 
 ## [Unreleased]
+### Change
+- Reset DPI while stripping meta.
 
 ## [2.16.6] - 2021-07-08
 ### Fix

+ 8 - 1
vips.c

@@ -626,7 +626,14 @@ vips_arrayjoin_go(VipsImage **in, VipsImage **out, int n) {
 
 int
 vips_strip(VipsImage *in, VipsImage **out) {
-  if (vips_copy(in, out, NULL)) return 1;
+  static double default_resolution = 72.0 / 25.4;
+
+  if (vips_copy(
+    in, out,
+    "xres", default_resolution,
+    "yres", default_resolution,
+    NULL
+  )) return 1;
 
   gchar **fields = vips_image_get_fields(in);