Over at #Inkscape, we are currently reverse-engineering the file format of Adobe #Illustrator so that we can natively read those files. We’re making good progress, but let me tell you…
.ai files are by a wide margin the most convoluted, confusing, redundant mess I have had the displeasure of working with.
But that‘s what you get when you have 40 years of historical cruft, with no conscious effort of maintaining consistency. We should not make the same mistake with our additions to #SVG.
Today‘s favorite discovery: it is mathematically impossible to place a radial gradient exactly at the corner of a rectangle in Illustrator.
The gradient is defined by its position (x,y) and its length l. But that’s not actually the radius of the gradient. To get that, you have to transform the rectangle to a 1x1 square centered at the origin, then measure the distance between (x,y) and the nearest corner and multiply with l to get the radius (then transform back).
But if (x,y) is the corner, you multiply l with 0 - so you cannot have a gradient radius larger than 0 in that case!
If my file format adventures are interesting to so many people, I should prepare a #FOSDEM talk about it, I guess?
If illustrator was a scientific computing software, this would mean that it chooses to be very good at solving singularly perturbed problems with boundary layers. Important applications in fluid dynamics.
Maybe everyone was just mistaken about the actual intended usage of AI ?
Me: trying to relax from my Fluid Mechanics PhD project by working on Inkscape
The PhD project: *Hello there, General Kenobi*
You're safe with Inkscape, plug flow admissible, no viscosity, no turbulence. :)
Is the format Turing complete?
It seems most old formats have so much cruft added they get to that stage even if it's not intended
@simonzerafa the format was based on PostScript initially. It still looks like that superficially, but a regular PostScript parser would give up quickly.
So the answer to your question is probably yes, but luckily Illustrator doesn‘t use that functionality
Ah! I was wondering!
Good luck with your mapping the nether regions of that file format
@joneuhauser You and the #inkscape team are awesome as hell
@joneuhauser tysm for doing this !!
@dflxh sure! I recently added support for HPGL, CGM, Afdesign (with Manpreet) and we haves new contributor which contributed an early version of a Vectornator / Curve import which we‘ll release with 1.4.1.
.ai support might be around for 1.4.2.
As always, do report all issues you find with those compatibility layers :)
@joneuhauser
That is actually quite awesome. Good luck.
@joneuhauser Seems like you haven't experienced the Freehand file format yet :)
@joneuhauser have a look at cubase files next, lol. same story.
@joneuhauser you might be familiar with this legendary comment about psd, or not, sharing it in case.
https://github.com/gco/xee/blob/master/XeePhotoshopLoader.m#L108
@tshirtman that is a very accurate description of ai files as well! I sense a pattern.
@joneuhauser that's the impression i got , hope you'll see it through!
@joneuhauser Keep up the good work !
Though I hate to break it to you but inkscape SVG support is very lacking, rendering it unable to understand non inkscape SVGs. I hope this will change in the future.
@joneuhauser @mehdi_benadel also do upload the offending files (or isolated examples if the full file is copyrighted)! Helps a lot with debugging.
@joneuhauser I've spent so much time figuring out file formats. It's frustrating and productive. Keep up the good work!
@joneuhauser Don't you think it may be also complicated by design, to discourage reverse engineering ?
@1HommeAzerty I live by „Never explain by malice what you can adequately explain with incompetence“.
If they wanted to make it more difficult to reverse-engineer, it would be much easier just to apply a non-standard compression algorithm instead of making up weird redundant data structures“.
But it might be a not-unwelcome side effect.
@joneuhauser @1HommeAzerty You the guy they were looking to poach?
Well done for being solid.
@Daniel_Blake @joneuhauser @1HommeAzerty That would be WimPum, the dev of the Linearity Curve extension
@joneuhauser Yes! The more your work on reverse-engineering the #AdobeIllustrator files becomes known, the better also for #Inkscape and free formats, tooling and all designers who do not want to be locked in. Also good as a #chaos_computer_club talk.
@niccokunzmann good idea, I’ll look into the CCC
@joneuhauser why not. Especially once inkscape support the ai file format. You can share the whole journey.