summaryrefslogtreecommitdiff
path: root/src/photos/PngSupport.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-06-14 20:36:17 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-06-14 20:36:17 +0200
commit31804433d72460cbe0a39f9f8ea5e76058d84cda (patch)
tree2084a84c39f159c6aea254775dc0880d52579d45 /src/photos/PngSupport.vala
parenta9898fb3f39c44a85876930ef6b2558052569ae6 (diff)
parentd443a3c2509889533ca812c163056bace396b586 (diff)
Update upstream source from tag 'upstream/0.32.1'
Update to upstream version '0.32.1' with Debian dir c460ad6e13d3c39eaa2d5399059385e64e6fba4c
Diffstat (limited to 'src/photos/PngSupport.vala')
-rw-r--r--src/photos/PngSupport.vala27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/photos/PngSupport.vala b/src/photos/PngSupport.vala
index c891136..e154fc4 100644
--- a/src/photos/PngSupport.vala
+++ b/src/photos/PngSupport.vala
@@ -88,33 +88,6 @@ public class PngReader : GdkReader {
public PngReader(string filepath) {
base (filepath, PhotoFileFormat.PNG);
}
-
- public override Gdk.Pixbuf scaled_read(Dimensions full, Dimensions scaled) throws Error {
- Gdk.Pixbuf result = null;
- /* if we encounter a situation where there are two orders of magnitude or more of
- difference between the full image size and the scaled size, and if the full image
- size has five or more decimal digits of precision, Gdk.Pixbuf.from_file_at_scale( ) can
- fail due to what appear to be floating-point round-off issues. This isn't surprising,
- since 32-bit floats only have 6-7 decimal digits of precision in their mantissa. In
- this case, we prefetch the image at a larger scale and then downsample it to the
- desired scale as a post-process step. This short-circuits Gdk.Pixbuf's buggy
- scaling code. */
- if (((full.width > 9999) || (full.height > 9999)) && ((scaled.width < 100) ||
- (scaled.height < 100))) {
- Dimensions prefetch_dimensions = full.get_scaled_by_constraint(1000,
- ScaleConstraint.DIMENSIONS);
-
- result = new Gdk.Pixbuf.from_file_at_scale(get_filepath(), prefetch_dimensions.width,
- prefetch_dimensions.height, false);
-
- result = result.scale_simple(scaled.width, scaled.height, Gdk.InterpType.HYPER);
- } else {
- result = new Gdk.Pixbuf.from_file_at_scale(get_filepath(), scaled.width,
- scaled.height, false);
- }
-
- return result;
- }
}
public class PngWriter : PhotoFileWriter {