ShokoAnime / ShokoServer

Repository for Shoko Server.
http://shokoanime.com/shoko-server/
MIT License
391 stars 75 forks source link

Image Management #427

Open ElementalCrisis opened 8 years ago

ElementalCrisis commented 8 years ago

Issue:

Solution

Enhancements

Related Issues:

maxpiva commented 8 years ago

This will help, and only keep the better resolution, > size.... Since providers give us, like 40 images, and there is only 2 o 3 really different, the other are the same image with different resolution / or size...

http://www.codeproject.com/Articles/374386/Simple-image-comparison-in-NET

bigretromike commented 8 years ago

@maxpiva I think that @ElementalCrisis didnt want to compare same image in different resolution ?! (the issue dont say anything like that).

imo, we can do this without external libs, just compare size (file and resolution) and if any is different delete local, redownload. The only downside (of any method here) will be that everytime you want to compare you will download it anyway - so it will be like downloading new set of images (ban alert).

We could make it to:

  1. read db, then read local file and if so compare file size - redownload if missing - (recheck, redownload, corrupt image fix)
  2. I wouldn't go in road of duplicate images - we could compare images as @maxpiva propose but we can hit a wall sooner-or-later with upscaled crapy images.. Im not saying its bad or anything but it overdoing, we could just submit better images/poster to anidb and more people benefit from it ;-)
ElementalCrisis commented 8 years ago

AniDB only provides a single image and that's a poster. We don't really need to compare with them, it's with TvDB.

da3dsoul commented 7 years ago

Also the duplicate image check is good for another reason, and that is that we only download 10 (by default) images, and if they are 8 of the same image and 2 others, there's really not a good variety.

ElementalCrisis commented 7 years ago

@da3dsoul https://stackoverflow.com/questions/210650/validate-image-from-file-in-c-sharp

bigretromike commented 7 years ago

@ElementalCrisis you probably post wrong link, it have nothing related to this problem 👍

ElementalCrisis commented 7 years ago

Nope, right link. We were talking about this issue in Discord and talking about recent image corruption issues and @da3dsoul asked me to post a possible solution we found I'm this topic.

bigretromike commented 7 years ago

oh, because issue was about comapring images based on content not checking if image header is broken :-) move along then ;p

ElementalCrisis commented 7 years ago

Pasting @maxpiva message as well.

Duplicate images, are not easy task, since you may have the same image at different resolutions, or the same image, with different kind of compression (png, jpg), or same resolution different compression, or same resolution, same compression but different metadata, because of that, for duplicate images, we need something usable. The propose is as follow, first deprecate per provider images, into, poster image, banner images, and background images, Second, using this or similar https://www.codeproject.com/Articles/374386/Simple-image-comparison-in-NET generate similar hashes from images, so every series will download images from all providers, but only keep, the better resolution/compression one (can be configured).

da3dsoul commented 7 years ago

Image validation done

Jimmyson commented 7 years ago

Does this happen to include a Image Duplication remover?

da3dsoul commented 7 years ago

Nope, all it does so far is validate images when downloading them

ElementalCrisis commented 7 years ago

I've updated the Related Issues section, since this is one of the big items for 3.9 we don't need to have them all done but should focus on the critical issues and then work our way towards the improvements and new features.

I recall @RickDB having some experience in this field.