summaryrefslogtreecommitdiff
path: root/src/photos/BmpSupport.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-06-28 21:35:52 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-06-28 21:35:52 +0200
commitb86540b743f1a87a163ffb811c8fe22a01fefa38 (patch)
treeb47cb3bb83c2377234226fb3987ab3320a987dd9 /src/photos/BmpSupport.vala
parentac6e0b731b9f0b2efd392e3309a5c07e2a66adad (diff)
parente905d8e16eec152d19797937f13ba3cf4b8f8aca (diff)
Merge branch 'release/debian/0.32.1-1'debian/0.32.1-1
Diffstat (limited to 'src/photos/BmpSupport.vala')
-rw-r--r--src/photos/BmpSupport.vala27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/photos/BmpSupport.vala b/src/photos/BmpSupport.vala
index a59a4d9..26ec911 100644
--- a/src/photos/BmpSupport.vala
+++ b/src/photos/BmpSupport.vala
@@ -90,33 +90,6 @@ public class BmpReader : GdkReader {
public BmpReader(string filepath) {
base (filepath, PhotoFileFormat.BMP);
}
-
- 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 BmpWriter : PhotoFileWriter {