-
Notifications
You must be signed in to change notification settings - Fork 1
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
EMF to PNG transformation errors #1
Comments
🚀 Transformation initiated! Once complete, the bot will comment with a link to the converted files. |
I have done some testing and I can confirm I can 100% reproduce the script conversion behavior by using the commands: There are other methods for conversion as well, on both mac os and linux and other unix systems, but these result in slightly different png's regarding density and resolution. The aforemention method results in the very same output as the script, on Linux and Mac OS. Despite my efforts, I could not get the script to work with the same behavior on Mac and Linux systems. So on non-windows, I think manual conversion is the only way.
So I stand behind my suggestion still, since I couldn't fix it in the script. Limitations for non-windows operating systems should be mentioned in the readme file and some instructions should be added on how to reproduce the same conversion one to one on other operating systems. |
@monsieuremre thanks for the issue report. We can document in readme, that conversion does not work on Linux and Mac OS. It would be enough. We should not put more effort into solving this problem. |
Opened in the wrong repo so closed. |
First of all, there is a very small error in the image conversion script.
The loop header
for image_name, image_path in images_to_convert
needs to be replaced withfor image_name, image_path in images_to_convert.items():
else python throws an error. For this I will create a pull, but there is a more important issue with image conversion.Unlucky for us the word documents include EMF files, which are non-universal and quite a bad choice for documentation purposes. This a proprietary file format from microsoft and is not an image per se, but rather as the name suggests, it is a meta file. It is a set of instructions as to how to construct an image.
We are doing the right thing by converting these into the universal png format. But here, the conversion requires the use of libraries that are to the best of my knowledge limited to windows only. Under other computer operating systems such as
Mac OS
orGNU/Linux
orChrome OS
, opening a EMF file in python will result in the following error:no decode delegate for this image format `EMF'
.Viewing the images works fine on these OS'es, but working with them is quite the hastle, which includes opening them in python. On these operating systems, there are ways to manually do the conversion from emf to png. There are several third party tools and libraries that work on Mac OS and Linux that I have tested.
I suggest the following changes:
I am going to create a pull request. If you would like to address this in another way please let me know. Waiting for feedback before creating the pull.
The text was updated successfully, but these errors were encountered: