105 lines
3.8 KiB
Diff
105 lines
3.8 KiB
Diff
diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
|
|
index 7b5e0ecb1db7aaa062fe0c9c2b0ee5476ada1329..45df931f00ea462c70ec78e1236ed4c383172eab 100644
|
|
--- a/src/extension/internal/pdfinput/pdf-input.cpp
|
|
+++ b/src/extension/internal/pdfinput/pdf-input.cpp
|
|
@@ -33,6 +33,7 @@
|
|
#include <poppler/glib/poppler.h>
|
|
#include <poppler/glib/poppler-document.h>
|
|
#include <poppler/glib/poppler-page.h>
|
|
+#include <poppler/goo/gmem.h>
|
|
#endif
|
|
|
|
#include <gdkmm/general.h>
|
|
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
|
|
index 6c78247dfbd21e3680dcac1396cfdda470d7995e..8b2e6f3d54341273eac5630ad95bc927d3519b7b 100644
|
|
--- a/src/extension/internal/pdfinput/svg-builder.cpp
|
|
+++ b/src/extension/internal/pdfinput/svg-builder.cpp
|
|
@@ -32,6 +32,7 @@
|
|
#include <poppler/GfxState.h>
|
|
#include <poppler/Page.h>
|
|
#include <poppler/Stream.h>
|
|
+#include <poppler/goo/gmem.h>
|
|
|
|
#include "color.h"
|
|
#include "color/cms-util.h"
|
|
@@ -2093,7 +2094,11 @@ Inkscape::XML::Node *SvgBuilder::_createImage(Stream *str, int width, int height
|
|
} else {
|
|
image_stream = new ImageStream(str, width, 1, 1);
|
|
}
|
|
+#if POPPLER_CHECK_VERSION(26, 0, 0)
|
|
+ image_stream->rewind();
|
|
+#else
|
|
image_stream->reset();
|
|
+#endif
|
|
|
|
// Convert grayscale values
|
|
unsigned char *buffer = new unsigned char[width];
|
|
@@ -2119,7 +2124,11 @@ Inkscape::XML::Node *SvgBuilder::_createImage(Stream *str, int width, int height
|
|
image_stream = new ImageStream(str, width,
|
|
color_map->getNumPixelComps(),
|
|
color_map->getBits());
|
|
+#if POPPLER_CHECK_VERSION(26, 0, 0)
|
|
+ image_stream->rewind();
|
|
+#else
|
|
image_stream->reset();
|
|
+#endif
|
|
|
|
// Convert RGB values
|
|
unsigned int *buffer = new unsigned int[width];
|
|
|
|
From 7e74f51fc097d725dde29fadff5440cc69658172 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Faist?= <faist@rexcontrols.cz>
|
|
Date: Mon, 2 Feb 2026 17:39:08 +0100
|
|
Subject: [PATCH] Fix warning with poppler 26.x.x
|
|
|
|
---
|
|
.../internal/pdfinput/svg-builder.cpp | 24 +++++++++++++++++--
|
|
1 file changed, 22 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
|
|
index 8b2e6f3d54..94d4342dc4 100644
|
|
--- a/src/extension/internal/pdfinput/svg-builder.cpp
|
|
+++ b/src/extension/internal/pdfinput/svg-builder.cpp
|
|
@@ -2095,7 +2095,17 @@ Inkscape::XML::Node *SvgBuilder::_createImage(Stream *str, int width, int height
|
|
image_stream = new ImageStream(str, width, 1, 1);
|
|
}
|
|
#if POPPLER_CHECK_VERSION(26, 0, 0)
|
|
- image_stream->rewind();
|
|
+ if(!image_stream->rewind())
|
|
+ {
|
|
+ g_warning("ImageStream: Failed to rewind image stream");
|
|
+ png_destroy_write_struct(&png_ptr, &info_ptr);
|
|
+ if (!_embed_images) {
|
|
+ fclose(fp);
|
|
+ g_free(file_name);
|
|
+ }
|
|
+ delete image_stream;
|
|
+ return nullptr;
|
|
+ }
|
|
#else
|
|
image_stream->reset();
|
|
#endif
|
|
@@ -2125,7 +2135,17 @@ Inkscape::XML::Node *SvgBuilder::_createImage(Stream *str, int width, int height
|
|
color_map->getNumPixelComps(),
|
|
color_map->getBits());
|
|
#if POPPLER_CHECK_VERSION(26, 0, 0)
|
|
- image_stream->rewind();
|
|
+ if(!image_stream->rewind())
|
|
+ {
|
|
+ g_warning("ImageStream: Failed to rewind image stream");
|
|
+ png_destroy_write_struct(&png_ptr, &info_ptr);
|
|
+ if (!_embed_images) {
|
|
+ fclose(fp);
|
|
+ g_free(file_name);
|
|
+ }
|
|
+ delete image_stream;
|
|
+ return nullptr;
|
|
+ }
|
|
#else
|
|
image_stream->reset();
|
|
#endif
|
|
--
|
|
GitLab
|
|
|
|
|