[Poppler-bugs] [Bug 102494] New: image::save() generates corrupted images on Windows

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Aug 31 14:28:10 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=102494

            Bug ID: 102494
           Summary: image::save() generates corrupted images on Windows
           Product: poppler
           Version: unspecified
          Hardware: Other
                OS: Windows (All)
            Status: NEW
          Severity: major
          Priority: medium
         Component: cpp frontend
          Assignee: poppler-bugs at lists.freedesktop.org
          Reporter: jeroen at berkeley.edu

Rendering pdf pages on Windows works great but saving the rendered image using
image.save() creates corrupted files. 

I tried both saving to 'png' and 'jpg' and both images were broken. Exactly the
same code works fine on MacOS and Linux. It looks like the image files are
truncated on Windows. Perhaps the file doesn't get closed properly?

    page_renderer pr;
    pr.set_render_hint(page_renderer::antialiasing, true);
    pr.set_render_hint(page_renderer::text_antialiasing, true);
    image img = pr.render_page(p, dpi, dpi);
    if(!img.is_valid())
      throw std::runtime_error("PDF rendering failure.");
    if(!img.save(filename, format, dpi))
      throw std::runtime_error("Failed to save file" + filename);

I am using poppler 0.57.0 on mingw-w64/gcc 4.9.3 but I have been able to
reproduce this problem with all other versions of poppler and mingw-w64.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20170831/537b3dd2/attachment.html>


More information about the Poppler-bugs mailing list