diff --git a/.gitignore b/.gitignore index 174e9e0..18cea60 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /poppler-0.73.0.tar.xz /poppler-test-2018-12-18-45f55f1e03b9bf3fbd334c31776b6f5e472889ec.tar.xz /poppler-0.84.0.tar.xz +/poppler-0.90.0.tar.xz diff --git a/0001-Revert-Remove-the-Qt4-frontend.patch b/0001-Revert-Remove-the-Qt4-frontend.patch index 6b67ba6..ecafbd7 100644 --- a/0001-Revert-Remove-the-Qt4-frontend.patch +++ b/0001-Revert-Remove-the-Qt4-frontend.patch @@ -261,7 +261,7 @@ index 5e3d6a17..431059fb 100644 +endif() + if (ENABLE_QT5) - find_package(Qt5Core) + find_package(Qt5Core 5.5) # Update QT_DISABLE_DEPRECATED_BEFORE in qt5/CMakeLists.txt when increasing this find_package(Qt5Gui) @@ -661,6 +671,9 @@ if(ENABLE_GLIB) add_subdirectory(glib) diff --git a/poppler-0.63.0-tiling-patterns.patch b/poppler-0.63.0-tiling-patterns.patch deleted file mode 100644 index 316a141..0000000 --- a/poppler-0.63.0-tiling-patterns.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 718d428984e3a84fda521c0f5e6d975c7390af2b Mon Sep 17 00:00:00 2001 -From: Marek Kasik -Date: Fri, 6 Apr 2018 15:06:46 +0200 -Subject: [PATCH] cairo: Fix tiling patterns when pattern cell is too far - -Rendering of tiling pattern which has pattern matrix moving pattern cell -far away can fail on allocation of memory. This commit solves the issue by -modifying of cairo pattern matrix so that its offset is closer to the path -filled by the pattern. - -https://bugs.freedesktop.org/show_bug.cgi?id=105905 ---- - poppler/CairoOutputDev.cc | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc -index 631ab27b..b2e730bf 100644 ---- a/poppler/CairoOutputDev.cc -+++ b/poppler/CairoOutputDev.cc -@@ -915,6 +915,8 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat - StrokePathClip *strokePathTmp; - bool adjusted_stroke_width_tmp; - cairo_pattern_t *maskTmp; -+ double xoffset, yoffset; -+ double det; - - width = bbox[2] - bbox[0]; - height = bbox[3] - bbox[1]; -@@ -976,6 +978,15 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat - if (cairo_pattern_status (pattern)) - return false; - -+ det = pmat[0] * pmat[3] - pmat[1] * pmat[2]; -+ if (fabs(det) < 0.000001) -+ return false; -+ -+ xoffset = round ((pmat[3] * pmat[4] - pmat[2] * pmat[5]) / (xStep * det)); -+ yoffset = - round ((pmat[1] * pmat[4] - pmat[0] * pmat[5]) / (yStep * det)); -+ pattern_matrix.x0 -= xoffset * pattern_matrix.xx * xStep + yoffset * pattern_matrix.xy * yStep; -+ pattern_matrix.y0 -= xoffset * pattern_matrix.yx * xStep + yoffset * pattern_matrix.yy * yStep; -+ - state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax); - cairo_rectangle (cairo, xMin, yMin, xMax - xMin, yMax - yMin); - --- -2.14.3 - diff --git a/poppler-0.90.0-qt4-update.patch b/poppler-0.90.0-qt4-update.patch new file mode 100644 index 0000000..56e208b --- /dev/null +++ b/poppler-0.90.0-qt4-update.patch @@ -0,0 +1,371 @@ +--- poppler-0.90.0/qt4/src/poppler-annotation.cc ++++ poppler-0.90.0/qt4/src/poppler-annotation.cc +@@ -789,7 +789,7 @@ Link* AnnotationPrivate::additionalActio + case Annotation::PageInvisibleAction: actionType = Annot::actionPageInvisible; break; + } + +- ::LinkAction *linkAction = nullptr; ++ std::unique_ptr<::LinkAction> linkAction = nullptr; + if ( pdfAnnot->getType() == Annot::typeScreen ) + linkAction = static_cast( pdfAnnot )->getAdditionalAction( actionType ); + else +@@ -798,7 +798,7 @@ Link* AnnotationPrivate::additionalActio + Link *link = nullptr; + + if ( linkAction ) +- link = PageData::convertLinkActionToLink( linkAction, parentDoc, QRectF() ); ++ link = PageData::convertLinkActionToLink( linkAction.get(), parentDoc, QRectF() ); + + return link; + } +--- poppler-0.90.0/qt4/src/poppler-document.cc ++++ poppler-0.90.0/qt4/src/poppler-document.cc +@@ -57,8 +57,6 @@ + + namespace Poppler { + +- int DocumentData::count = 0; +- + Document *Document::load(const QString &filePath, const QByteArray &ownerPassword, + const QByteArray &userPassword) + { +@@ -633,7 +631,16 @@ namespace Poppler { + void Document::setColorDisplayProfile(void* outputProfileA) + { + #if defined(USE_CMS) +- GfxColorSpace::setDisplayProfile((cmsHPROFILE)outputProfileA); ++ if (m_doc->m_sRGBProfile && m_doc->m_sRGBProfile.get() == outputProfileA) { ++ // Catch the special case that the user passes the sRGB profile ++ m_doc->m_displayProfile = m_doc->m_sRGBProfile; ++ return; ++ } ++ if (m_doc->m_displayProfile && m_doc->m_displayProfile.get() == outputProfileA) { ++ // Catch the special case that the user passes the display profile ++ return; ++ } ++ m_doc->m_displayProfile = make_GfxLCMSProfilePtr(outputProfileA); + #else + Q_UNUSED(outputProfileA); + #endif +@@ -642,9 +649,8 @@ namespace Poppler { + void Document::setColorDisplayProfileName(const QString &name) + { + #if defined(USE_CMS) +- GooString *profileName = QStringToGooString( name ); +- GfxColorSpace::setDisplayProfileName(profileName); +- delete profileName; ++ void* rawprofile = cmsOpenProfileFromFile(name.toLocal8Bit().constData(),"r"); ++ m_doc->m_displayProfile = make_GfxLCMSProfilePtr(rawprofile); + #else + Q_UNUSED(name); + #endif +@@ -653,7 +659,10 @@ namespace Poppler { + void* Document::colorRgbProfile() const + { + #if defined(USE_CMS) +- return (void*)GfxColorSpace::getRGBProfile(); ++ if (!m_doc->m_sRGBProfile) { ++ m_doc->m_sRGBProfile = make_GfxLCMSProfilePtr(cmsCreate_sRGBProfile()); ++ } ++ return m_doc->m_sRGBProfile.get(); + #else + return NULL; + #endif +@@ -662,7 +671,7 @@ namespace Poppler { + void* Document::colorDisplayProfile() const + { + #if defined(USE_CMS) +- return (void*)GfxColorSpace::getDisplayProfile(); ++ return m_doc->m_displayProfile.get(); + #else + return NULL; + #endif +--- poppler-0.90.0/qt4/src/poppler-link.cc ++++ poppler-0.90.0/qt4/src/poppler-link.cc +@@ -232,7 +232,7 @@ class LinkMoviePrivate : public LinkPriv + if ( data.namedDest && !ld && !data.externalDest ) + { + deleteDest = true; +- ld = data.doc->doc->findDest( data.namedDest ); ++ ld = data.doc->doc->findDest( data.namedDest ).release(); + } + // in case this destination was named one, and it was not resolved + if ( data.namedDest && !ld ) +--- poppler-0.90.0/qt4/src/poppler-page.cc ++++ poppler-0.90.0/qt4/src/poppler-page.cc +@@ -110,30 +110,30 @@ Link* PageData::convertLinkActionToLink( + + case actionNamed: + { +- const char * name = ((LinkNamed *)a)->getName()->c_str(); +- if ( !strcmp( name, "NextPage" ) ) ++ const std::string& name = ((LinkNamed *)a)->getName(); ++ if ( name == "NextPage" ) + popplerLink = new LinkAction( linkArea, LinkAction::PageNext ); +- else if ( !strcmp( name, "PrevPage" ) ) ++ else if ( name == "PrevPage" ) + popplerLink = new LinkAction( linkArea, LinkAction::PagePrev ); +- else if ( !strcmp( name, "FirstPage" ) ) ++ else if ( name == "FirstPage" ) + popplerLink = new LinkAction( linkArea, LinkAction::PageFirst ); +- else if ( !strcmp( name, "LastPage" ) ) ++ else if ( name == "LastPage" ) + popplerLink = new LinkAction( linkArea, LinkAction::PageLast ); +- else if ( !strcmp( name, "GoBack" ) ) ++ else if ( name == "GoBack" ) + popplerLink = new LinkAction( linkArea, LinkAction::HistoryBack ); +- else if ( !strcmp( name, "GoForward" ) ) ++ else if ( name == "GoForward" ) + popplerLink = new LinkAction( linkArea, LinkAction::HistoryForward ); +- else if ( !strcmp( name, "Quit" ) ) ++ else if ( name == "Quit" ) + popplerLink = new LinkAction( linkArea, LinkAction::Quit ); +- else if ( !strcmp( name, "GoToPage" ) ) ++ else if ( name == "GoToPage" ) + popplerLink = new LinkAction( linkArea, LinkAction::GoToPage ); +- else if ( !strcmp( name, "Find" ) ) ++ else if ( name == "Find" ) + popplerLink = new LinkAction( linkArea, LinkAction::Find ); +- else if ( !strcmp( name, "FullScreen" ) ) ++ else if ( name == "FullScreen" ) + popplerLink = new LinkAction( linkArea, LinkAction::Presentation ); +- else if ( !strcmp( name, "Print" ) ) ++ else if ( name == "Print" ) + popplerLink = new LinkAction( linkArea, LinkAction::Print ); +- else if ( !strcmp( name, "Close" ) ) ++ else if ( name == "Close" ) + { + // acroread closes the document always, doesnt care whether + // its presentation mode or not +@@ -149,7 +149,7 @@ Link* PageData::convertLinkActionToLink( + + case actionURI: + { +- popplerLink = new LinkBrowse( linkArea, ((LinkURI *)a)->getURI()->c_str() ); ++ popplerLink = new LinkBrowse( linkArea, ((LinkURI *)a)->getURI().c_str() ); + } + break; + +@@ -362,6 +362,10 @@ QImage Page::renderToImage(double xres, + splash_output.setFreeTypeHinting(m_page->parentDoc->m_hints & Document::TextHinting ? true : false, + m_page->parentDoc->m_hints & Document::TextSlightHinting ? true : false); + ++#ifdef USE_CMS ++ splash_output.setDisplayProfile(m_page->parentDoc->m_displayProfile); ++#endif ++ + splash_output.startDoc(m_page->parentDoc->doc); + + m_page->parentDoc->doc->displayPageSlice(&splash_output, m_page->index + 1, xres, yres, +@@ -442,6 +447,11 @@ bool Page::renderToPainter(QPainter* pai + painter->translate(x == -1 ? 0 : -x, y == -1 ? 0 : -y); + ArthurOutputDev arthur_output(painter); + arthur_output.startDoc(m_page->parentDoc->doc->getXRef()); ++ ++#ifdef USE_CMS ++ arthur_output.setDisplayProfile(m_page->parentDoc->m_displayProfile); ++#endif ++ + m_page->parentDoc->doc->displayPageSlice(&arthur_output, + m_page->index + 1, + xres, +@@ -671,12 +681,11 @@ Link *Page::action( PageAction act ) con + Dict *dict = o.getDict(); + const char *key = act == Page::Opening ? "O" : "C"; + Object o2 = dict->lookup((char*)key); +- ::LinkAction *lact = ::LinkAction::parseAction(&o2, m_page->parentDoc->doc->getCatalog()->getBaseURI() ); ++ std::unique_ptr<::LinkAction> lact = ::LinkAction::parseAction(&o2, m_page->parentDoc->doc->getCatalog()->getBaseURI() ); + Link *popplerLink = NULL; + if (lact != NULL) + { +- popplerLink = m_page->convertLinkActionToLink(lact, QRectF()); +- delete lact; ++ popplerLink = m_page->convertLinkActionToLink(lact.get(), QRectF()); + } + return popplerLink; + } +--- poppler-0.90.0/qt4/src/poppler-private.cc ++++ poppler-0.90.0/qt4/src/poppler-private.cc +@@ -49,15 +49,13 @@ namespace Debug { + + } + +- static UnicodeMap *utf8Map = 0; +- + void setDebugErrorFunction(PopplerDebugFunc function, const QVariant &closure) + { + Debug::debugFunction = function ? function : Debug::qDebugDebugFunction; + Debug::debugClosure = closure; + } + +- static void qt4ErrorFunction(void * /*data*/, ErrorCategory /*category*/, Goffset pos, const char *msg) ++ void qt4ErrorFunction(ErrorCategory /*category*/, Goffset pos, const char *msg) + { + QString emsg; + +@@ -74,12 +72,7 @@ namespace Debug { + } + + QString unicodeToQString(const Unicode* u, int len) { +- if (!utf8Map) +- { +- GooString enc("UTF-8"); +- utf8Map = globalParams->getUnicodeMap(&enc); +- utf8Map->incRefCnt(); +- } ++ const UnicodeMap *utf8Map = globalParams->getUtf8Map(); + + // ignore the last character if it is 0x0 + if ((len > 0) && (u[len - 1] == 0)) +@@ -99,34 +92,25 @@ namespace Debug { + } + + QString UnicodeParsedString(const GooString *s1) { +- if ( !s1 || s1->getLength() == 0 ) ++ return (s1) ? UnicodeParsedString(s1->toStr()) : QString(); ++ } ++ ++ QString UnicodeParsedString(const std::string& s1) { ++ if ( s1.empty() ) + return QString(); + +- const char *cString; +- int stringLength; +- bool deleteCString; +- if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getLength() > 1 && ( s1->getChar(1) & 0xff ) == 0xff ) ) +- { +- cString = s1->c_str(); +- stringLength = s1->getLength(); +- deleteCString = false; +- } +- else ++ if ( GooString::hasUnicodeMarker(s1) || GooString::hasUnicodeMarkerLE(s1) ) + { +- cString = pdfDocEncodingToUTF16(s1, &stringLength); +- deleteCString = true; ++ return QString::fromUtf16(reinterpret_cast(s1.c_str()), s1.size() / 2); + } +- +- QString result; +- // i = 2 to skip the unicode marker +- for ( int i = 2; i < stringLength; i += 2 ) ++ else + { +- const Unicode u = ( ( cString[i] & 0xff ) << 8 ) | ( cString[i+1] & 0xff ); +- result += QChar( u ); +- } +- if (deleteCString) ++ int stringLength; ++ const char *cString = pdfDocEncodingToUTF16(s1, &stringLength); ++ auto result = QString::fromUtf16(reinterpret_cast(cString), stringLength / 2); + delete[] cString; +- return result; ++ return result; ++ } + } + + GooString *QStringToUnicodeGooString(const QString &s) { +@@ -221,7 +205,7 @@ namespace Debug { + case actionURI: + { + const LinkURI * u = static_cast< const LinkURI * >( a ); +- e->setAttribute( "DestinationURI", u->getURI()->c_str() ); ++ e->setAttribute( "DestinationURI", u->getURI().c_str() ); + } + default: ; + } +@@ -233,13 +217,6 @@ namespace Debug { + delete (OptContentModel *)m_optContentModel; + delete doc; + delete m_fontInfoIterator; +- +- count --; +- if ( count == 0 ) +- { +- utf8Map = nullptr; +- globalParams.reset(); +- } + } + + void DocumentData::init() +@@ -249,14 +226,6 @@ namespace Debug { + paperColor = Qt::white; + m_hints = 0; + m_optContentModel = 0; +- +- if ( count == 0 ) +- { +- utf8Map = nullptr; +- globalParams = std::make_unique(); +- setErrorCallback(qt4ErrorFunction, nullptr); +- } +- count ++; + } + + +--- poppler-0.90.0/qt4/src/poppler-private.h ++++ poppler-0.90.0/qt4/src/poppler-private.h +@@ -55,6 +55,8 @@ class FormWidget; + QString unicodeToQString(const Unicode* u, int len); + + QString UnicodeParsedString(const GooString *s1); ++ ++ QString UnicodeParsedString(const std::string& s1); + + GooString *QStringToUnicodeGooString(const QString &s); + +@@ -65,7 +67,7 @@ namespace Poppler { + + GooString *QDateTimeToUnicodeGooString(const QDateTime &dt); + +- void qt4ErrorFunction(int pos, char *msg, va_list args); ++ void qt4ErrorFunction(ErrorCategory /*category*/, Goffset pos, const char *msg); + + class LinkDestinationData + { +@@ -65,9 +67,10 @@ namespace Poppler { + bool externalDest; + }; + +- class DocumentData { ++ class DocumentData : private GlobalParamsIniter { + public: +- DocumentData(const QString &filePath, GooString *ownerPassword, GooString *userPassword) ++ DocumentData(const QString &filePath, GooString *ownerPassword, GooString *userPassword) : ++ GlobalParamsIniter(qt4ErrorFunction) + { + init(); + m_filePath = filePath; +@@ -102,7 +105,8 @@ namespace Poppler { + delete userPassword; + } + +- DocumentData(const QByteArray &data, GooString *ownerPassword, GooString *userPassword) ++ DocumentData(const QByteArray &data, GooString *ownerPassword, GooString *userPassword) : ++ GlobalParamsIniter(qt4ErrorFunction) + { + fileContents = data; + MemStream *str = new MemStream((char*)fileContents.data(), 0, fileContents.length(), Object(objNull)); +@@ -148,7 +152,10 @@ namespace Poppler { + QPointer m_optContentModel; + QColor paperColor; + int m_hints; +- static int count; ++#ifdef USE_CMS ++ GfxLCMSProfilePtr m_sRGBProfile; ++ GfxLCMSProfilePtr m_displayProfile; ++#endif + }; + + class FontInfoData +--- poppler-0.90.0/qt4/src/poppler-ps-converter.cc ++++ poppler-0.90.0/qt4/src/poppler-ps-converter.cc +@@ -235,7 +235,7 @@ bool PSConverter::convert() + d->marginBottom, + d->paperWidth - d->marginRight, + d->paperHeight - d->marginTop, +- (d->opts & ForceRasterization)); ++ (d->opts & ForceRasterization) ? psAlwaysRasterize : psRasterizeWhenNeeded); + + if (d->opts & StrictMargins) + { diff --git a/poppler.spec b/poppler.spec index 7a414ee..e8b35fc 100644 --- a/poppler.spec +++ b/poppler.spec @@ -3,8 +3,8 @@ Summary: PDF rendering library Name: poppler -Version: 0.84.0 -Release: 2%{?dist} +Version: 0.90.0 +Release: 1%{?dist} License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT URL: http://poppler.freedesktop.org/ Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz @@ -15,9 +15,6 @@ Source1: %{name}-test-%{test_date}-%{test_sha}.tar.xz Patch0: poppler-0.30.0-rotated-words-selection.patch Patch1: 0001-Revert-Remove-the-Qt4-frontend.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1557355 -Patch2: poppler-0.63.0-tiling-patterns.patch - Patch3: poppler-0.67.0-qt4-const.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1696636 @@ -25,6 +22,9 @@ Patch4: poppler-0.73.0-PSOutputDev-buffer-read.patch Patch5: poppler-0.84.0-MacroPushRequiredVars.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1673727 +Patch6: poppler-0.90.0-qt4-update.patch + BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: gettext-devel @@ -255,6 +255,10 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %{_mandir}/man1/* %changelog +* Wed Jul 08 2020 Marek Kasik - 0.90.0-1 +- Update to 0.90.0 +- Resolves: #1673727 + * Thu Jan 30 2020 Fedora Release Engineering - 0.84.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/sources b/sources index 12f1819..a8b52cd 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (poppler-0.84.0.tar.xz) = e00aca76b4909621b79ec68374529396ddba756af5d60d86750095dfebbabe5b576aa7c873c3fcfabaff28c89e3e37e826d4a0fac356d76ef966500514a772e7 +SHA512 (poppler-0.90.0.tar.xz) = 3b2a45c7fcdc41b0dad80b6454cd8bb50a6625537edbc537898790ef4b6425bb62e1934fd2aaa8565be9c045ab1ac40a8de2e939c5b5abf0254d8e6c833b4450 SHA512 (poppler-test-2018-12-18-45f55f1e03b9bf3fbd334c31776b6f5e472889ec.tar.xz) = fa1d8c92ca5bc9ebd7453dfb78f34fb44d014621fe698aa4a3fa9bd17bd0d302ca6ba36f4dd46a1ef030c0b7a30729d4bacb6d01c5c67d429c897e4f5ab331e8