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

white image edge detection, leads to images displayed with border #2883

Merged
merged 8 commits into from
Feb 10, 2025

Conversation

jrochkind
Copy link
Contributor

@jrochkind jrochkind commented Feb 6, 2025

Replacement for #2864, ref #2491

This was pretty easy?

But it's a bit precious.... on the plus side, if it does break, it's probably just what people less picky would have had anyway? Took care of "recent items" too.

On the negative side... it actually will make our test suite slower, cause any test doing a "real" ingest with metadata extraction will run this now... our architecture doesn't give us a great way to turn it off in tests (and would we want to? not sure).

  • white edge detection with ImageMagick
  • fix description to be more clear
  • detect white edges and store in metadata on ingest
  • iamge border around white-edge-detected images in ThumbComponent, with styling in three context

After merge/deploy

  • Run rake task in production to detect white edges on Neville Catalog vols 1 and 2
    • heroku run rake scihist:data_fixes:detect_white_edge WORK_FRIENDLIER_ID=jvpvngs -r production
    • heroku run rake scihist:data_fixes:detect_white_edge WORK_FRIENDLIER_ID=zft4n19 -r production

@jrochkind jrochkind force-pushed the white_border_detection branch from ec8cb7b to 2958d50 Compare February 6, 2025 20:30
@jrochkind
Copy link
Contributor Author

oh we don't have magick on github? That's weird. Need to confirm we have it on heroku, and that it's included in our system env tests.

Maybe we're still using deprecated convert? We can do that.

@jrochkind jrochkind marked this pull request as draft February 6, 2025 20:40
@jrochkind jrochkind changed the title white border detection white image edge detection, leads to images displayed with border Feb 6, 2025
@jrochkind
Copy link
Contributor Author

jrochkind commented Feb 10, 2025

OK, there's a known failure mode here, where an ALL white exclusively white image will not be detected as white-edge, because --trim doesn't trim on it.

For now we're just going to postpone dealing with that -- we can manually set the metadata value on certain images if we need to. Or handle it otherwise in subsequent PR.

@jrochkind jrochkind force-pushed the white_border_detection branch from 910f1c1 to 6a884b6 Compare February 10, 2025 20:39
@jrochkind
Copy link
Contributor Author

OK I'm gonna do border in viewer in a separate PR, so this is ready.

@jrochkind jrochkind marked this pull request as ready for review February 10, 2025 21:19
@jrochkind jrochkind marked this pull request as draft February 10, 2025 21:29
@jrochkind
Copy link
Contributor Author

OK, all white images now detected as white-edged too.

@jrochkind jrochkind marked this pull request as ready for review February 10, 2025 21:32
@jrochkind jrochkind force-pushed the white_border_detection branch from e83d64b to 33cd244 Compare February 10, 2025 21:38
@jrochkind jrochkind merged commit 4ef6e1d into master Feb 10, 2025
1 check passed
@jrochkind jrochkind deleted the white_border_detection branch February 10, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants