stfnk / Cewe2pdf

Converts CEWE FOTOWELT .mcf files to high quality pdf
MIT License
3 stars 0 forks source link

Missing background DesignID #3

Open Knorke89 opened 3 years ago

Knorke89 commented 3 years ago

Hello,

I get some erros with missing background DesignID 41, 201 and 6176.

Can you take a look in the attached log file to fix the problem?

cewe2pdf.log

stfnk commented 3 years ago

Hi, thanks for reporting and the log file! Will fix the missing IDs in the next days!

Knorke89 commented 3 years ago

Thanks for the fast feedback. I would test after the fix.

stfnk commented 3 years ago

Hi, so i just looked into the missing IDs and i'm afraid i cant fix them easily for now.

6176 is a two color gradient, and 41 seems to be a texture, but cewe2pdf currently only supports single color backgrounds.

201 is just white and actually should work, not sure why that throws an error in your case... need to do some more testing for that one.

I am aware that this limitation is annoying and it's actually not a huge thing to fix - but it requires some deeper changes to how cewe2pdf handles the designIDs.

Some more details: Currently the colors for all single color IDs are stored directly in a c# dictionary (auto-generated on my end) which allows cewe2pdf to run without accessing the actual Cewe Software installation directory. There is no way to add missing IDs from the user side, whithout rebuilding the software, which is... annoying :P

The preferred solution would be to directly load the necessary designIDs from the Cewe installation and always use them as images. This would also pave the way for clipart support and be just a better solution in general, as all necessary designIDs should be available on the user's system, including the ones Cewe sometime seems to download on the fly. Could probably also fallback to a user-configurable file to allow for easier updates for missing IDs...

I actually started to work on a more robust system but never really finished it up properly.

This is something i definitely want to fix, hope to find some time over the holidays. This issue certainly spawned new motivation for working on this 😃

Knorke89 commented 3 years ago

Hi, thank you for the clarification. If you need someone for the testing I can help you if necessary.

Knorke89 commented 3 years ago

Hi, at first: Happy New Year! Do you have any updates?

stfnk commented 3 years ago

Happy new year! Slooowly making progress :)

Work is happening in the dev-new-idsystem branch. Besides a rewrite of the id system I just added the last big missing feature, ImageBackgrounds. For my test files all background types now work, except for the cover background which is currently left blank... probably needs some fresh eyes tomorrow.

Could you try this test build with your file? https://github.com/stfnk/Cewe2pdf/releases/download/v0.3.0-alpha/Cewe2pdf_v0.3.0-alpha1.zip Usage changed slightly: if you run the program like: Cewe2pdf.exe "yourFile.mcf" "export.pdf" and there is an error saying: [Error] Cewe Installation directory not found please open the config.txt file next to the Cewe2pdf.exe and change the path in the second line to point to the root folder of your cewe installation. (The program needs access to that folder now to load backgrounds directly from the source files. Cewe2pdf tries to find the installation in the common locations on windows but not sure how well that works.

Don't expect too much - its still very experimental, but should produce a much better result now. At least I hope so :D

Note that cliparts are still not supported at all. Just had a quick look and have not yet figured out where they are stored in the installation... this should be straightforward to fix though.

Knorke89 commented 3 years ago

Thank you :)

I would try the test build but the download link doesn't work.
The path doesn't exist.

For the problem with the cliparts. The are stored under this path in separate folders. "C:\ProgramData\hps\16175\addons" I hope this help you.

stfnk commented 3 years ago

Oh you're right... i have to publish the release for downlaods to work... https://github.com/stfnk/Cewe2pdf/releases/tag/v0.3.0-alpha

stfnk commented 3 years ago

Oh and thanks for the ProgramData path 👍 I did not know about that - thats probably also where downloaded backgrounds get saved... will take a closer look.

Knorke89 commented 3 years ago

I have tried the test version. The log-file is attached. cewe2pdf.log

I found that some fonts are missing. The are located under the path: C:\ProgramData\hps\16175\photofun\fonts

Knorke89 commented 3 years ago

Glad I can help you 👍

stfnk commented 3 years ago

Great, thanks for the log! That's really helpful. Will fix the errors.

So some backgrounds are in jpg format... They are not really consistent with ther resources xD

stfnk commented 3 years ago

Hi, I just uploaded a new build: https://github.com/stfnk/Cewe2pdf/releases/download/v0.3.0-alpha2/Cewe2pdf_v0.3.0-alpha2.zip The errors from your log are now fixed.

Let me know if it works for you :)

Knorke89 commented 3 years ago

Looks good :) Attached is the log file. cewe2pdf.log

Now I only miss some fonts and the cliparts

Knorke89 commented 3 years ago

Hi, i have tried alpha4. I saw that you are trying to add the missing fonts and cliparts.

But I get an "warning" of the path. I think this in individual to every user.

[Warning] Font directory at: 'C:\ProgramData\hps\6822\photofun\fonts' does not exist. Skipping. For me the correct directory is 'C:\ProgramData\hps\16175\photofun\fonts'

See the attached log file. cewe2pdf.log

stfnk commented 3 years ago

Hi, good point. Would be an easy fix to recursivly scan the ProgramData\hps path for fonts dirs. I'll add it to my todo list for 0.3.0 Quite busy with work atm, not sure when i'll have time to work on this.

Just as a quick update: Cliparts are not likely to happen soon. They are stored in a weird format i did not manage to read or convert yet. Not sure if it's possible at all.

stfnk commented 3 years ago

Font loading should be fixed by 6cacc5a204f8ec1c23e77e09bb351c6e1ffaf2ad New alpha5 uploaded. Kind of rushed this tho, hope i didn't miss or break something.

Knorke89 commented 3 years ago

Font loading seems to work. cewe2pdf.log But strangely the conversion process takes twice as long.

Can I help you with the clip art problem?

stfnk commented 3 years ago

Just looked into the slow conversion speed and added several improvements until i found the real issue introduced in alpha5. So this new alpha6 is (for my test files at least) about 1.5 to 2 times faster than earlier versions.

Unless i'm missing something the cliparts are stored as binary .clp files for which i found no way of reading or converting. I was hoping cliparts would just be .svg - or any other standard vector format - somewhere in the installation, but i don't really know how to proceed with this unknown filetype 😞

Knorke89 commented 3 years ago

Sorry for the late reply. Yes now it's faster.

cewe2pdf.log

With cairosvg you can convert .clp in a .svg file. Look in the Repo bash0/cewe2pdf

gizmo21 commented 3 years ago

Thanx for finally having a quite good working version again, after the longtime ago good ol "m*f2pdf". I have a missing background in alpha6 in my log, it is from a very old file which I converted to dm cewe 7.1.2. so not quite sure you can fix it.

[Error]   DesignID '9014' not found.
[Error]   Design ID '9014' not found.
[Error]   Background image for id '9014' was null.
[Error]   DesignID '9014' not found.
[Error]   Design ID '9014' not found.
[Error]   Background image for id '9014' was null. 

If I see this correctly it could be C:\Program Files\d\d-Fotwelt\Resources\photofun\backgrounds\multicolor\476.webp according to C:\Program Files\d\d-Fotwelt\Resources\photofun\categories\backgrounds_default.xml (paths_to_bg.zip <- perhaps delete if not suitable for public ): <template autoThumb="background" category="Hintergrund" designElementId="476" designElementType="background" filename="../backgrounds/multicolor/476.webp" name="476" pagetype="normalpage,fullcover,calendarcoverfront" subcategory="Multicolor,category-pattern" type="fotobook,calendar,gift,card,doublepage,playingcard" multicolor="1" [multicolor_id="9014"/>]

Update: Oh and could you perhaps add an option to just insert a white background color for "missing background" errors, instead of a bright turquoise in my case (perhaps that is the colorshade that is combined with the missing webp). This way one could perhaps still use the pdf if errors persist

Knorke89 commented 3 years ago

Do you have any update for this topic?