djdembeck / Audnexus.bundle

An Audnexus client proof of concept for Plex, providing rich author and audiobook data. Developed in Python, offering enhanced user experiences via Plex's legacy plugin agent system.
GNU General Public License v3.0
480 stars 21 forks source link

Square Author Images #76

Closed csandman closed 1 year ago

csandman commented 1 year ago

This is my PR for https://github.com/laxamentumtech/audnexus/issues/530

Like I mentioned in this comment, The centering actually has nothing to do with any sort of facial recognition, it just turned out that the photos in portrait layout look better when they're cropped to the top. So instead of making a new custom option, I just set things up to crop each portrait image to a square centered at the top, and crop each landscape image at the horizontal center.

There is no real need for cropping the horizontal images, as Plex will do the same thing automatically, but I added it anyway in case you'd prefer images to be consistently coming back as square. If you don't want them cropped, I (or you) can just remove L328-L336.

Let me know your thoughts!


Here is what my Authors looked like after running this new agent:

image

Compared to what they looked like before this change:

image
djdembeck commented 1 year ago

Incredible work! SO glad you found a way around just white-cropped images in some instances too.

csandman commented 1 year ago

Incredible work! SO glad you found a way around just white-cropped images in some instances too.

Same haha, I'm a little disappointed that I was wrong about the intelligent facial centering, but I do think this looks a lot better than before!

csandman commented 1 year ago

I had one more thought about this, by the way, and I'm not sure if you have a good solution. This is kind of related to this issue: https://github.com/djdembeck/Audnexus.bundle/issues/58#issuecomment-1237430519

When I update one of my existing instances of this agent (I keep setting up copies to test fresh library creations) to use this change, the new artist images are added, but not selected as default. Do you know if there's a way to make these new images automatically replace the existing ones?

djdembeck commented 1 year ago

Yeah, I need to spend more time with that. I looked at some other agents' code, but they are movie agents, so we can only do some things they do. Essentially, we'd have to clear images for the artist and reload them in the correct order. It didn't work for me in my previous testing for albums, but I never investigated further.

csandman commented 1 year ago

Is the part you're talking about the helper.metadata.posters.validate_keys([helper.thumb]) in the compile_metadata function for the AudiobookAlbum agent? Because I can't seem to find any info on that being a built-in function anywhere, haha. Relying on docs from 2011 is a bit rough though.