libcdr-based CDR importing flips images vertically

Bug #1114042 reported by Alexandre Prokoudine
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Medium
Unassigned
Inkscape Devlibs
Fix Released
Medium
jazzynico

Bug Description

There's a bunch of bugs with libcdr-based importer of CDR files, most notably all bitmaps are flipped vertically. Personally, I suspect it has something to do with incorrect reading coordinates.

Here's what Inkscape does:

https://dl.dropbox.com/u/55576315/cdr/TC9980801-LAYOUT-PC1-inkscape-cdr-input-vs-original.png

While here's what cdr2odg produces:

https://dl.dropbox.com/u/55576315/cdr/TC9980801-LAYOUT-PC1-cdr2odg-result.png

Here's the file:

https://dl.dropbox.com/u/55576315/cdr/TC9990901-LAYOUT-PC1.cdr

And here's PDF preview:

https://dl.dropbox.com/u/55576315/cdr/TC9990901-PREVIEW.pdf

It would be great if Fridrich could be persuaded to still add saving flowed text output. I know we screwed that one up, but we do need a workaround.

Tags: importing cdr
Revision history for this message
su_v (suv-lp) wrote :

> Here's what Inkscape does:

Inkscape simply renders what SVG it receives from libcdr - there is no additional processing of the content on inkscape's side at all. libcdr's command line tool 'cdr2xhtml' produces the same output (inverted embedded images) as gets imported to Inkscape. IMHO this ought to be filed for libcdr, not inkscape:
<http://www.freedesktop.org/wiki/Software/libcdr>
<http://bugs.freedesktop.org/>

> It would be great if Fridrich could be persuaded to still add saving flowed text
> output. I know we screwed that one up, but we do need a workaround.

To quote from an earlier conversation on #inkscape:
12:46 TrainedMonkey : su_v: funny enough, we discovered that someone uses libvisio here https://bobswift.atlassian.net/wiki/display/CVP/How+to+install+SVG+conversion+support :) and files bugs about absence of wrapped text in SVG
12:46 su_v : with those I get the same results (mostly, except for multi-line text) as shown in the LO screenshots
12:46 TrainedMonkey : su_v: yeah, text is a problem
12:49 TrainedMonkey : su_v: if someone from inkscape decides to maintain the svg part, I am ready to allow sodipodi namespace there, along with using your text-frames, but will not do it if it is only me working on it, since I don't use the svg for other purpose then quick viewing of the pics
12:50 su_v : TrainedMonkey: based on current developer activity in Inkscape trunk, I doubt this will happen :(
12:50 su_v : OTOH one never knows ;)
12:50 TrainedMonkey : exactly, it is good to wait, it is sweet to hope
12:51 su_v : There is a blueprint to refactor Inkscape's internal <text> handling completely (since current 'Flowed Text' isn't a solution either)
12:51 su_v : not compliant with the SVG 1.1 spec, not supported by other SVG renderers
12:51 su_v : etc.
12:53 su_v : (no fallback, or <switch> variant)
12:54 TrainedMonkey : yeah, that is why I did not bother
12:54 TrainedMonkey : the same with svg multi-page stuff that nobody supports
12:58 su_v : the "svg part" would be <http://cgit.freedesktop.org/libreoffice/libcdr/tree/src/lib/CDRSVGGenerator.cpp> ?
12:58 TrainedMonkey : su_v: sure
12:59 TrainedMonkey : that is the class that takes the api callbacks and converts into svg xml
12:59 TrainedMonkey : su_v: I just tested btw, and my own mingw-built icu works well at least for russian ecoding
12:59 TrainedMonkey : encoding
12:59 su_v : and <http://cgit.freedesktop.org/libreoffice/contrib/libvisio/tree/src/lib/VSDSVGGenerator.cpp>

tags: added: cdr importing
Revision history for this message
su_v (suv-lp) wrote :

Alexandre Prokoudine wrote:
> There's a bunch of bugs with libcdr-based importer of CDR files (…)

I will contact Fridrich about how (or where) best to file&track libcdr issues with SVG output which affect e.g. cdr-input in Inkscape and the commandline tool 'cdr2xhtml', but not LibreOffice.

> It would be great if Fridrich could be persuaded to still add saving flowed text
> output. I know we screwed that one up, but we do need a workaround.

Could you please file this as separate request, and/or bring it up on the mailing list?

Changed in inkscape:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
su_v (suv-lp) wrote :

> most notably all bitmaps are flipped vertically.

Fixed upstream in libcdr:
<http://cgit.freedesktop.org/libreoffice/libcdr/commit/?id=16aad5b68991bb0ae2874f8a7fa196fab8fe5990>

Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
Fridrich (fridrich-strba) wrote :

Alexandre: the doucument opened in CDR9 (which version the file claims to be) lookes like this: http://people.freedesktop.org/~fridrich/CDR9-TC.png
So it does not necessarily correspond to the *PREVIEW* image. And I fear, I will not be able to do it better then CDR9 :)

jazzynico (jazzynico)
Changed in inkscape-devlibs:
assignee: nobody → JazzyNico (jazzynico)
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
su_v (suv-lp) wrote :

libcdr 0.0.11 has been released, which contains the fix for the issue with incorrectly flipped bitmap images:
<http://cgit.freedesktop.org/libreoffice/libcdr/tag/?id=libcdr-0.0.11>

Revision history for this message
su_v (suv-lp) wrote :

Closing for project Inkscape - upstream bug in libcdr, new release with fix available.

<off-topic>the quality of CDR files from stocklayouts.com seems questionable, at least based on the example used for this report: the PDF preview was created with QuarkExpress/Adobe Distiller based on a QuarkExpress file (TC9990901-LAYOUT-MST1.qxd), and apparently does not correspond with how the CDR file renders even in CorelDRAW itself</off-topic>

Changed in inkscape:
status: Triaged → Invalid
Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Is it worth adding a versioned dependency for pkg-config?

Revision history for this message
su_v (suv-lp) wrote :

Personally I don't think that's needed yet (AFAICT bitmap images embedded in other CDR sample files imported not vertically flipped, even with libcdr 0.0.10 [1]).

[1] e.g. some of the CDR test data from UniConvertor:
<http://uniconvertor.svn.sourceforge.net/viewvc/uniconvertor/formats/CDR/>

OTOH this release contains a proper fix for the import of the test file of Inkscape bug #882594 (originally filed against UniConvertor).
<http://cgit.freedesktop.org/libreoffice/libcdr/commit/?id=fabf05464f137875a5ee74fcc21938161ecca077>

jazzynico (jazzynico)
Changed in inkscape-devlibs:
assignee: jazzynico (jazzynico) → nobody
Revision history for this message
jazzynico (jazzynico) wrote :

Just for the record, libcdr-0.1.2 requires librevenge>0.0.1, which itself requires an update of our boost libs (new version [due to long-long warnings] and additional packages [archives, and maybe others]).
Same requirements for libvisio-0.1.5.

Revision history for this message
jazzynico (jazzynico) wrote :

Ok. It seems that librevenge still fail to configure with recent Boost versions (tested with 1.60) if launched with the default configure options. But it works when using: --disable-tests --disable-werror

jazzynico (jazzynico)
Changed in inkscape-devlibs:
assignee: nobody → jazzynico (jazzynico)
status: Triaged → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

libcdr updated to version 0.1.2 in devlibs r57, Inkscape trunk r14567 and 0.91.x r13857.

Note that the previous version was libcdr-0.0.12, and thus the bug was already fixed in the released Inkscape 0.91 version.

Changed in inkscape-devlibs:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.