ComicRackCE icon indicating copy to clipboard operation
ComicRackCE copied to clipboard

Updating Publisher.zip/Format.zip

Open killo3967 opened this issue 2 years ago • 53 comments

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

killo3967 avatar Apr 04 '24 08:04 killo3967

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 avatar Apr 04 '24 20:04 maforget

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 avatar Apr 05 '24 19:04 maforget

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 avatar Apr 06 '24 01:04 maforget

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

maforget avatar Apr 07 '24 03:04 maforget

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.

killo3967 avatar Apr 07 '24 12:04 killo3967

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 ,.

maforget avatar Apr 07 '24 17:04 maforget

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.

killo3967 avatar Apr 07 '24 18:04 killo3967

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 avatar Apr 07 '24 18:04 maforget

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 avatar Apr 07 '24 23:04 maforget

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.

maforget avatar Apr 08 '24 01:04 maforget

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

killo3967 avatar Apr 10 '24 18:04 killo3967

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

maforget avatar Apr 10 '24 20:04 maforget

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...)

ucapato avatar Apr 10 '24 21:04 ucapato

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

maforget avatar Apr 10 '24 21:04 maforget

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 avatar Apr 14 '24 17:04 ucapato

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…

ucapato avatar Apr 14 '24 17:04 ucapato

Uploading Publishers.zip…

Your Publishers.zip didn't upload.

maforget avatar Apr 14 '24 22:04 maforget

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

ucapato avatar Apr 17 '24 20:04 ucapato

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?

jrft1379 avatar Jun 08 '24 13:06 jrft1379

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.

maforget avatar Jun 08 '24 18:06 maforget

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

  • Avatar Press and Andrews McMeel already existed in the original Publisher.zip, but they were quite old and with a different color than today's. Maybe I should keep both logs and mark with dates like it is made with DC Comics for example. Need some advise on that.

Publishers.zip

ucapato avatar Jun 28 '24 06:06 ucapato

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

denis-anikin avatar Jun 28 '24 09:06 denis-anikin

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

denis-anikin avatar Jun 28 '24 10:06 denis-anikin

Hi @denis-anikin

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

ucapato avatar Jun 28 '24 11:06 ucapato

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

ucapato avatar Jun 28 '24 13:06 ucapato

I've updated the way the build is done in regard to these icons. The icons are not stored as zip files anymore, they are now stored as individual icons instead. So it is way easier to see what as been updated, added or removed. So if you check the commit 0340ab422341a4cc8f1121769d7d4050c63c2d50, you can even see the icons directly on github now. For example the icon for Avatar Press shows the icon that was removed and the one that was added.

It will make cooperating easier, anyone that wants to contribute can just change the icons in the Resources\Icons folder and create a commit. Then you can do a PR, so your contribution will be tracked on github.

The project files will take any folder that is in Resources\Icons and add them to the project without any modification. It also support any number of directory that are present in that folder, for future proofing in case we want to add new zips. A powershell script will be called during the build and zip them up.

maforget avatar Jul 02 '24 02:07 maforget

Great @maforget,

Thanks a lot for this way of working to update the Resources\Icon folder. So, in other words, do we need to use Git knowledge to be able to update in case bringing up a new icon? I can copy the ComiRackCE Repo to my machine, perform the updates I want, and then add/commit/push to the Main Repository here in Git, isn't that right? Sorry for the silly question, but I am trying to learn how to use Github productively.

ucapato avatar Jul 02 '24 08:07 ucapato

I ended up making a fork of ComicRackCE, so I could add, commit and pushed the proposed Format icons to my own Fork. But I am note sure if this is what was exactly proposed here or if there is a better practice.

ucapato avatar Jul 02 '24 10:07 ucapato

@ucapato Yes that is the proper way to do it. You can use GitHub directly for basic things like uploading new files, renaming. Using a git client for local changes is required for more features. If you don't have or require the whole Visual Studio program just to edit icons, the Github desktop client is pretty good at using the git features with a GUI.

  • Clone your fork to a local folder, this is important since if you are downloading the repo only, git won't work.
  • It is suggested to keep the master branch clean. If you commit on it directly it will be harder to sync the changes with mine. That can be done via a Update from upstream/master on the client or on Github a sync button will appear if there are changes to fetch.
  • You should instead create a branch based on the latest master when you want to create a PR. With the client it is easy to switch branches and the files on your computer will change to reflect that. In the Github client if you set the fork behavior in the repository settings to contribute to parent, when you create a fork it will be based on my master.
  • With your patch branch checked-out it is only a matter of replacing the files in the folder.
  • The client will show you what was modified, deleted, added. You can then create a commit by giving it some description of the change.
  • That commit is local only, you can do changes or append to that commit while only local. Once you Push it, it will be sent to Github and at that point doing any further changes is not recommended. Instead just push another commit to fix any mistake.
  • Then either on Github or through their client you can create a Pull Request from your patch branch to my master. Any further changes you or I push to your patch branch will show up in the PR.
  • I have actions setup so that on PR, once I approve it. A build for that PR will be done and a bot will post a link to it in the PR thread, so it is easier to test that build. On each and every commit you do a the build will be kept updated.
  • Once the PR is merged into my master, you can then delete that patch branch if you want. But most just keep it and just do another branch on further changes.

[!WARNING] If you do any contribution, I suggest that you make sure the checkbox, keep your email private is enabled in Github settings or your email address will be attached to each and every commit you do. With that setting enabled a github email address proxy will be used instead.

maforget avatar Jul 02 '24 17:07 maforget

Hi @maforget ,

Appreciate your assistance and patience in explaining how Git and Github work. I am still sometimes lost with the technical words and behavior, but to ride a bike we need to fall sometimes, right? Here we go:

  1. I started with the left foot. Had done a fork, clone it into my Client (I am using IntelliJ instead of Visual Studio), and updated the Format folder with my suggested Icons in the Master Branch. Only after that, I have read your advice here.

  2. Still, no problem (I guess), I've found some guidelines and I was able to restore my branch by adding the Upstream Remote from your Master, resetting it, and pushing your Master to my Fork again. So now I got my Master's exactly as yours.

  3. Now I have created a branch (git checkout -b NewUpdatedIcons in IntelliJ Terminal window) for my Master Branch and desired changes I'll apply to this NewUpdatedIcons branch only.

  4. When you mention " In the GitHub client if you set the fork behavior in the repository settings to contribute to parent, when you create a fork it will be based on my master". How do I achieve that? Or, should I simply click on "Contribute" when adding changes to my NewUpdatedIcons branch as I see in the snapshot below:

image
  1. But if my assumption on Item 4 is correct. I first need to make my changes, add, commit, and push in my client branch, and this will be "sent" to my branch in Github, only then I can do PR. By PR I understand I am asking to add changes to your Repo. Did I get this right?

ucapato avatar Jul 03 '24 00:07 ucapato