ill2svg.pl replacement in python

Bug #169749 reported by Nitrofurano
4
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
bbyak

Bug Description

since .ai drawings were opened on Inkscape by a
script named ill2svg.pl, which is still plenty of
feature lacks, and perl language
is not that excellence in depurability, i started to
code a replacement named ai2svg.py

for now it opens joined pathes, textboxes, etc., but
is still not opening ai1 documents (which ill2svg.pl
also doesn't), as well is providing errors when
opening
documents saved by Adobe Illustrator because some
lines are broken only with cr, and not lf, crlf or
lfcr - i'm now working on this bug
walkaround

the idea of recoding it on python is not only the
better depurability, as well helping more people
would want to help fixing or improving it

for now i'm posting what i'm having ready until now

Related branches

Revision history for this message
Nitrofurano (nitrofurano) wrote :
Revision history for this message
Horkana-users (horkana-users) wrote :

"depurability"
I am not sure what you mean, and since you use that word
twice I assume it was intentional not a spelling mistake.
perhaps you are translating the word from another language?

It is great that you are interested to rewrite this script
in Python and make other updates, but please try not to
criticize Perl language since different people like
different programming languages.

The developers will probably want to wait until your
importer supports more features than the existing importer
but Python is very popular and many other Inkscape
extensions are in Python so I am sure there will be lots of
interest.
Best of luck.

Revision history for this message
Nitrofurano (nitrofurano) wrote : ai2svg.py update (2006 aug 21)

Other attachments

Revision history for this message
Nitrofurano (nitrofurano) wrote :

well, i'm not criticizing Perl at all - maybe Perl has some
unique features (which i couldn't understand their syntax,
but surelly they have, as well i'm having huge difficulty to
learn it)

the some comments i writed i think were more as common sense
than personal oppinion, since there are some companies (like
DreamWorks (!)) hiring people to convert their perl scripts
to python - sorry if personally i offended someone(s), which
were not my intention - i'm focusing more on the easier
learning curve (in my oppinion and feedback) of python which
can help more a fast improvement of Inkscape development

thanks and regards!

Revision history for this message
Nitrofurano (nitrofurano) wrote : 3rd version of ai2svg - fixes some bugs from 2nd version

Other attachments

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Thank you, we are certainly interested in your script, if
only because we carry Python with Inkscape and therefore,
unlike the old Perl script, yours will be working out of the
box on Windows. I also appreciate your providing test AI
files. I hope we will be able to include this into 0.45.

So far I found one bug: when run on 5accd32up_ai1.ai, the
script produces malformed XML with the end of the tag repeated:

<path id="path_0" d="
M 548 700.0
L 548 42.0
L 78 42.0
L 78 700.0
L 548 700.0
z" style="fill-rule:evenodd;fill:#000000;fill-opacity:1;
stroke:none;stroke-opacity:1;stroke-width:1.0;
stroke-linecap:butt;stroke-linejoin:miter;
stroke-miterlimit:4.0;stroke-dashoffset:0;
visibility:visible;display:inline;overflow:visible"/>

z" style="fill-rule:evenodd;fill:#000000;fill-opacity:1;
stroke:none;stroke-opacity:1;stroke-width:1.0;
stroke-linecap:butt;stroke-linejoin:miter;
stroke-miterlimit:4.0;stroke-dashoffset:0;
visibility:visible;display:inline;overflow:visible"/>

And of course, if you have a newer version with more
features supported, please post it!

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Another bug: on 5accd32up_ai7.ai:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="612.0pt" height="792.0pt">

Traceback (most recent call last):
  File "ai2svg.py", line 259, in ?
    txboxline_st=locstrinfo(text_st,"(",")")
  File "ai2svg.py", line 29, in locstrinfo
    if a_st[adra]==b_st[adrb]:adrb+=1
IndexError: string index out of range

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

And another one: attached Cisco_systems_logo.ai fails to
load - your script seems to grok it in general, but it
produces lots of unclosed tags etc., so inkscape fails
parsing the svg output.

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Here's another file, a.ai, on which it fails in a similar way.

Revision history for this message
Kidproto (kidproto) wrote :

Cool...buliabyak, I'm assigning this one to you because of
your interest in this (based on the comments you've made :)

Jon

Revision history for this message
Bryce Harrington (bryce) wrote :

Let's hold off on this until it can be proven to not break
where the existing script works, and that it produces better
results.

Revision history for this message
Aaron C Spike (acspike) wrote : a few proposed tweaks

Other attachments

Revision history for this message
ScislaC (scislac) wrote :

Originator: NO

is this patch still relevant given our pdf import and what I understand to
be XSLT stylesheets to help import the old ai files?

Revision history for this message
anatoly techtonik (techtonik) wrote :

Originator: NO

I would like to ask that also. If the script is needed then I would
suggest a script to gather all .ai files and try to convert them with both
utilities to see which one handles them best.

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

We just need help on this one. ANyone who can test this script and verify
that it works? We will then commit this patch.

Ryan Lerch (ryanlerch)
Changed in inkscape:
assignee: buliabyak-users → buliabyak
status: New → In Progress
jazzynico (jazzynico)
tags: added: ai extensions-plugins importing
Revision history for this message
jazzynico (jazzynico) wrote :

Uniconvertor now support postscript based uniconvertor versions (up to AI 9).
Could we use it as a replacement?

Revision history for this message
jazzynico (jazzynico) wrote :

Well, now the main difficulty is to find an AI file version 8 or below...
Could somebody attach one so that I can test uniconvertor import?
Thanks!

Revision history for this message
jazzynico (jazzynico) wrote :

Please ignore my last comment (test files are attached in comment #0...).

Revision history for this message
jazzynico (jazzynico) wrote :

I've noticed no difference between the old perl imported files and the new uniconvertor imported ones.
Fix committed in revision 8957.

Changed in inkscape:
milestone: none → 0.48
status: In Progress → Fix Committed
jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → 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.