maforget / ComicRackCE

A Community Edition for the legendary Comic Book Manager ComicRack. ComicRack is back from the dead.
GNU General Public License v2.0
213 stars 20 forks source link

Updating Publisher.zip/Format.zip #62

Open killo3967 opened 2 months ago

killo3967 commented 2 months ago

Describe the bug When updating the program in windows the installation overwrite publisher.zip

Could be posible to not ovewrite the files on this path "C:\Program Files\ComicRack Community Edition\Resources\Icons" if the files are newer?

I added a more complete publisher.zip if you want to update it.

Publishers.zip

maforget commented 2 months ago

There is an option in the installer to not install "Additional images, icons and backgrounds". This should do what you want.

I can't access my computer right now, but I will gladly update the Publisher file the moment I can.

maforget commented 2 months ago

From #63 by @killo3967

Publisher logo images that have names with accents, accents, and umlauts are not displayed.

In my case i updated the publisher.zip with the logos of:

Éditions Glénat Les Humanoïdes Associés Denoël Graphic

But not logos show in Tiles-view. Tested also in old comicrack and works fine.

maforget commented 2 months ago

Ok regarding the accented characters not appearing in the new version. This is a change from the SharpZipLib in the new versions. The way character encoding as changed from the default.

Now you can either set character encoding manually when reading:

https://github.com/maforget/ComicRackCE/blob/cb76e9bf6412a10056c64b25fd73fe83063116b7/cYo.Common/Compression/ZipFileFolder.cs#L20-L23

could be changed to:

public ZipFileFolder(string zipFile)
{
    //437 is the default Zip char Encoding. 850 is the default western windows
    this.zipFile = new ZipFile(zipFile, StringCodec.FromCodePage(437));
}

Or when creating the Zip file force the UTF-8 flag for the entry and that way it will be detected automatically. This can be achieve (at least with 7-Zip), by either:

  1. Set the windows settings to "Beta: Use Unicode UTF-8 for worldwide language support"
  2. When creating the zip add cu in the Parameters textbox. It will force UTF8 on entries that uses it.

You can confirm the file is correctly created by opening it in 7-Zip and clicking on an entry that had accents and pressing info. Under characteristics you will see NTFS : UTF8 instead of NTFS up.

Try this file: Publishers.zip P.S. I've added Glénat to the string, because most of my books are all scrapped under Glénat and not Éditions Glénat.


Also regarding your initial remark about not overwriting the Publisher file, in addition to the option I mentioned. You can actually have multiples files. The search pattern is Publishers*.zip, so you could add anything and have _Publisher_French.zip_ for example.

You can also add them into your data folder. It supports, alternate configuration (-ac) and portable mode also (-local). Some folder the program will look into:

"{InstallDir}\Resources\Icons"
"%ProgramData%\cYo\ComicRack Community Edition\Resources\Icons"
"{DataDir}\Resources\Icons"
maforget commented 2 months ago

I've updated the Publishers.zip based on yours in fc2947db477d5afde88966710d2bd13e5a70371b, but There are still a lot that might need updating.

I will let this issue open as a place to update the Publishers.zip

killo3967 commented 2 months ago

I follow your instruction to add "cu" parameter when compressing the folder, but dont work. After compress I check that the file "Glenat#Glénat#Glenat Italia#Glénat Spain#Éditions Glénat.png" have the NTFS:UTF8 characteristic and it does. After this, I copy the file and rename, the copy, to Éditions Glénat.png and now it works ahd comicRack diskplay the logo. Could be the "#"?

I don't know why your file works and mine no.

I checked the headers of both pulishers.zp files and they are complete diferent. What software do you use to compress the folder? I use 7-zip 23.01(x64) in windows 11.

maforget commented 2 months ago

I use the same software. 1 thing I've discovered is that you can't rename a file after it is compressed with cu it loses UTF8.

And I can confirm it is the é É, they are read as ,.

killo3967 commented 2 months ago

I'm sorry if I didn't make myself clear, but don't rename it afterwards, rename it before recompressing it. Let's see if this time I explain better. I have taken the file "Glenat#Glénat#Glenat Italia#Glénat Spain#Éditions Glénat.png" and I have duplicated and renamed it to "Éditions Glénat.png", then I have compressed it with the option "cu" and it has shown me the logo in those comics that had the Publisher to "Éditions Glénat", but those that had it for example to "Glenat" or any of its variants has not shown it.

What surprises me is that with the file you sent me it does show the logos in all the variations, that's why I say that either I'm not doing something or the programs or procedures we are using are different.

maforget commented 2 months ago

In the file I sent, I've added Glénat to the line. Because you had Glenat (without the é), but not Glénat (with the é), which is what the scrapper returns for most Glénat comics. Maybe that is why mine is working on more comics.

maforget commented 2 months ago

Was on mobile, didn't read your message completly. So you have "Glenat#Glénat#Glenat Italia#Glénat Spain#Éditions Glénat.png" along side "Éditions Glénat.png"? It shouldn't change anything, it would take only 1 Éditions Glénat, the first one it encounters.

Here are the settings I've used: image

A note from what I saw in the 7-zip discussions pages on sourceforge, the setting I mentioned "Beta: Use Unicode UTF-8 for worldwide language support" can change the behavior of 7-zip. Normally it sets it to UTF8 only if it is needed on an entry. Maybe windows code page can affect it also, like western vs eastern.

I could change the program so it uses code page 537, which is the default for zip files and it should be universal for everyone. I just want to test if files with say Japanese Characters would work also with 537.

maforget commented 2 months ago

After some test with Japanese characters, i've updated the default Code Page to OEM (437). This should permit wide compatibility with pretty much all Zip software, without any special settings (aka the cu parameter).

WIth either 7-zip or WinRAR when using Japanese character it will force it to be UTF8, as there is no choice. Windows will just say that it can't create the zip. Since the Japanese entry is UTF8 it is still read correctly alongside entries like Glénat, which are also read correctly even if they aren't UTF8.

With this change e1a7a1b7e3549436482b54c047f7e2162b39513b all accented character are read correctly regardless of the software used, at least WinRAR, 7-Zip & Windows works correctly.

killo3967 commented 2 months ago

Tested and now CR could display the logos, anyway i'll use cn option in future. Thanks very much.

maforget commented 2 months ago

I've added some myself. I didn't resize them, because they would lose too much detail and the program doesn't seem to care.

Publishers.zip

ucapato commented 2 months ago

Can use this thread to bring other Publisher Icons to be added in future updates for Publishers.zip? As I had some self made Publisher Icons to bring in.

I also had some icons for Book Formats as well (e.g: Omnibus, Series instead of the standars Limited Series...)

maforget commented 2 months ago

Yes that's the point to share our files so we can update it.

ucapato commented 2 months ago

Hi,

I created some icons for Formats:

Series.png (icon: SER): For Series (So, the original file "Limite Series#Series.png") was renamed to #Limited Series.png") Omnibus.png (icon: OMN): For Omnibus Fan Made.png (icon: FME): For fans that want to make their self art work Edit.png (icon: ED)

Formats.zip

ucapato commented 2 months ago

I've added some myself. I didn't resize them, because they would lose too much detail and the program doesn't seem to care.

Publishers.zip

For this Publishers.zip file, I added a few more from the collection I have:

Globo.png Marvel Now!.png Pipoca & Nanquim.png Rio Gráfica e Editora.png Webtoon#Line Webtoon.png

[Uploading Publishers.zip…]()

maforget commented 2 months ago

Uploading Publishers.zip…

Your Publishers.zip didn't upload.

ucapato commented 2 months ago

Uploading Publishers.zip…

Your Publishers.zip didn't upload.

Sorry,

Here it goes

For this Publishers.zip file, I added a few more from the collection I have:

Globo.png Marvel Now!.png Pipoca & Nanquim.png Rio Gráfica e Editora.png Webtoon#Line Webtoon.png Publishers.zip

jrft1379 commented 2 weeks ago

Question about multiple publishers: There are plenty of books that have more than one publisher (Amalgam Comics, for example, are from DC and Marvel). How do you get CR to recognize that in the icons? I've tried a couple of methods, but they don't seem to work.

For reference, I have the individual publishers separated by a comma, that way they also show under the individual publisher when I narrow my library down.

I tried to have the icon names match the field name (i.e. DC, Marvel), but I realized that didn't work because CR isn't recognizing them as one entity that gets a special icon.

Also, I've noticed that the "/" character has no replacement value when it comes to the icons. For example, AiT/Planet Lar won't show up. I've tried substituting the "/" with "-" and just leaving a space instead. Neither worked for displaying the icon.

Any thoughts or ideas for either of these?

maforget commented 2 weeks ago

Question about multiple publishers: There are plenty of books that have more than one publisher (Amalgam Comics, for example, are from DC and Marvel). How do you get CR to recognize that in the icons? I've tried a couple of methods, but they don't seem to work.

For reference, I have the individual publishers separated by a comma, that way they also show under the individual publisher when I narrow my library down.

The Publisher field isn't a multi value field like Tags for example. So adding a comma will not give you 2 value just a value that has a comma in it. But when parsing the Publisher filenames it does split it by comma and #. https://github.com/maforget/ComicRackCE/blob/f8cf2f46f10d2d781b2030cd9c9a5c365f77574c/ComicRack/Program.cs#L946-L969

The program returns an array of icons when checking them, so technically it might be possible. I am looking at the tags section, it checks for text in the Tags section in the Special.zip file. https://github.com/maforget/ComicRackCE/blob/f8cf2f46f10d2d781b2030cd9c9a5c365f77574c/ComicRack.Engine/ComicBook.cs#L1861-L1943 https://github.com/maforget/ComicRackCE/blob/f8cf2f46f10d2d781b2030cd9c9a5c365f77574c/ComicRack.Engine/ComicBook.cs#L1841-L1849

Solution may be to have 1 be the Imprint the other the Publisher, have a special icon with the 2 and use the map.ini file for special characters. So you could do an icon that has DC & Marvel and call it via the map.ini if it has special char so DC_Comics_Marvel.png = DC Comics, Marvel as an example. Check the Formats.zip for an existent example. Or use the Tags section with a special icon.

I don't know if multiple publisher are very prominent that it would require changing how they work internally, but implementing a way to spit out more than 1 icon, seems to be possible without any UI work.

ucapato commented 1 day ago

Hi,

During my Collection Catalog process, I added some more publishers to Publisher.zip. All the previous icons were kept. In addition we have:

Amigo Comics#Amigo.png Andrews McMeel#Andrews McMeel Publishing.png (update) Avatar Press.png (update) Black Mask#Black Mask Studios.png Bloch#Bloch Infanto Juvenil.png D-Arte#Editora D-Arte.png Dead Dog.png Delcourt.png (update) Devir Livraria.png DMG Entertainment#DMG#Valiant Comics#DMG Valiant Entertainment.png Dom Quixote Publicações.png Ediouro.png Ego#Ego Editora.png Farrar, Straus and Giroux#Farrar Straus Giroux#Farrar, Straus, Giroux.png First Comics#First.png (update) Fox Atomic Comics.png Graphic India.png Great Big Comics.png Legendary Comics.png Mudnag.png Mythopoeia.png Mythos Editora.png Now Comics.png Planeta Cómic.png Rizzoli Lizard.png Simon and Schuster#Simon & Schuster.png Skript#Skript Editora.png Super Genius Comics.png Super Nova Produções#Super Nova.png Ten Speed Press.png Ubisoft#Ubisoft Entertainment.png Vecchi editora.png Warren#A Warren Magazine.png

Publishers.zip

denis-anikin commented 22 hours ago

Any reason to update "Zenescope Entertainment"? In the original archive of old ComicRack there was a transparent background, now white

denis-anikin commented 22 hours ago

Same with "Drawn and Quarterly#Drawn & Quarterly" if I'm not mistaken. Transparency is gone.

ucapato commented 21 hours ago

Hi @denis-anikin

Probably resolution was a bit better at those. But I'll remove the white background and update the zip content.

ucapato commented 19 hours ago

Here they come,

All the latest additions as previous mentioned, plus the removal background from "Drawn and Quarterly#Drawn & Quarterly" and "Zenescope Entertainment".

Publishers.zip