-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New version of the Dia plugin #2
Comments
Hm... Is your one a fork of original or of this (my) one? |
...and does my one calculate them incorrectly? |
I took your code as a starting point / example, but wrote most of the logic from scratch.
Would you mind if I updated the MediaWiki page so it describes and points to this new plugin? |
About this - I think it's not correct to just set $wgMediaHandlers['application/x-gzip'] = 'DiaHandler'; I.e. it will call DiaHandler for all gz files, and there are at least .svgz ones - these do not contain dia... |
Thanks for the feedback! |
Your Dia.body.php, line 67:
This is also bad - do you generate the thumbnail directly nearby to the source file instead of inside the thumbnail directory? I've just discovered SVG support in my version didn't work correctly in MW >= 1.19 because $dstPath in transform() is inside /tmp in these versions, not inside the real thumbnail directory, and the .svg file wasn't copied from /tmp after generation. Fixed it, and also removed nominal size (as in your version). Removed the ancient mime types patch, and slightly updated the readme. I'll still use my version in mediawiki4intranet because it outputs SVG as an <object> with PNG fallback which may be still needed for old browsers. If you want to update URL on the page, please do not remove link to my version, but of course you're free to also add your one as an alternative... |
Also note that your method won't work - MediaWiki will deny uploading gzipped dia files because of mime type and extension mismatch. You need to patch mime.types (add dia extension to application/x-gzip line) for this to work. |
I wrote a new version of the Dia plugin, which solves a few problems which this one has.
It renders the diagrams as
.svg
instead of.png
, and also calulates the dimensions correctly. Please check it out, and let me know what you think.Suggestions for improvement are welcome.
The text was updated successfully, but these errors were encountered: