Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to Default Performer Images (for Accessibility) #1489

Merged
merged 16 commits into from
Aug 10, 2021

Conversation

capnrowdy
Copy link
Contributor

@capnrowdy capnrowdy commented Jun 7, 2021

Fixes #1396 (some caveats, see below).

Added:

  • Accessibility Form Group created under "Interface"
  • Added Setting for "Use non-striped default performer images", with the requisite backend code.
  • When this setting is enabled, new performers that are created that require a default image will be generated from an accessible box.
  • A new folder for images in static/performer_female_accessible has been created with two images (sourced with as free restrictions as I could find as per IMAGE_LICENSES.md, but happy to change / be guided on this one.

Known Issues:

  • This does not retrospectively change existing performer images which do not conform. Not sure how to go about this, as I could not find the code paths responsible for pre-existing images? I suspect DB would be involved in this. Perhaps a task is needed?
  • There is no code path for male accessible default images as (currently) we do not require it, however I would imagine if we want to go for a stylistic consistency perhaps we should have performer_male_accessible as well.

Added:
 - Accessibility Form Group created under "Interface"
 - Added Setting for "Use non-striped default performer images", with the requisite backend code.
 - When this setting is enabled, new performers that are created that require a default image will be generated from an accessible box.
 - A new folder for images in "static/performer_female_accessible" has been created with two images (sourced with as free restrictions as I could find as per IMAGE_LICENSES.md, but happy to change / be guided on this one.

Known Issues:
 - This does not retrospectively change existing performer images which do not conform. Not sure how to go about this, as I could not find the code paths responsible for pre-existing images? I suspect DB would be involved in this. Perhaps a task is needed?
 - There is no code path for male accessible default images as (currently) we do not require it, however I would imagine if we want to go for a stylistic consistency perhaps we should have performer_male_accessible as well.
@capnrowdy capnrowdy marked this pull request as ready for review June 7, 2021 09:18
@capnrowdy capnrowdy changed the title Fixes #1396 (with caveats) Changes to Default Performer Images (for Accessibility) Jun 7, 2021
@WithoutPants
Copy link
Collaborator

I think that this is a bit of an over-complicated solution to the original problem.

We only need to provide a mechanism for the user to supply their own images.

My preference would be the following:

  • add a configuration setting for "default performer image location".
  • this config setting would be passed to getRandomPerformerImageUsingName. If not empty, then it would read a random file from the directory, instead of from the box
  • filenames should be read from the directory on the first read, then cached
  • configured directory can have subdirectories for each gender, using the directory itself if the subdirectory can not be accessed
  • fall back to the box images if an image cannot be found

This change will change performer images for performers created more recently (I don't remember the commit that changed the behaviour) - if a performer does not have an image set, then it uses a random one generated from the name. This is resolved at request time, and is not persisted. Performers created a few versions ago had the image persisted - these will have to have the image cleared manually.

As an aside, we can remove the stripes from the default images fairly easily. It will just take some manual time spent removing them with gimp or whatever. This would resolve the accessibilty issue altogether without the need to implement this feature (although this feature would still be useful). This would mean that everyone's default images would change, but provided that the plain images don't look too bad, I think we can live with this for the purposes of being more accessible. Plus, we could provide the old images that people can use with this feature if necessary.

@WithoutPants WithoutPants added the feature Pull requests that add a new feature label Aug 3, 2021
@WithoutPants WithoutPants added this to the Version 0.9.0 milestone Aug 3, 2021
pkg/api/images.go Outdated Show resolved Hide resolved
@WithoutPants
Copy link
Collaborator

I've updated packr so that we can utilise Folder which prevents trying to pack the custom folder. It now initialises on startup or if the directory changes. One thing that I noticed is that if you select a folder with a heap of files, it takes a very long time to initialise. Under normal usage it should be fine.

@WithoutPants WithoutPants merged commit 404eaa3 into stashapp:develop Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull requests that add a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Accessibility - Ability to Change "No Image" Default Image
3 participants