Skip to content

Add getFilename() method for descriptive image names#33

Open
Jah-yee wants to merge 1 commit into
niumoo:mainfrom
Jah-yee:feature/descriptive-filenames
Open

Add getFilename() method for descriptive image names#33
Jah-yee wants to merge 1 commit into
niumoo:mainfrom
Jah-yee:feature/descriptive-filenames

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented Mar 19, 2026

Summary

This PR adds a method to the class that generates descriptive filenames from image descriptions.

Changes

  • Added method to that:
    • Extracts the main subject from the copyright text (e.g., "Short-beaked echidna")
    • Creates filename-safe strings by replacing special characters
    • Limits filename length to 50 characters
    • Combines date and subject:

Example

Input:
Output:

This addresses issue #25: add short description to image names.

Testing

The method handles edge cases:

  • Empty or null descriptions: falls back to date-only filename
  • Very long descriptions: truncated to 50 characters
  • Special characters: removed or replaced with hyphens

… descriptions

This adds a getFilename() method that extracts the main subject from
the copyright text and creates descriptive filenames.

Example: 'Short-beaked echidna, Adelaide Hills, Australia'
Returns: '2026-03-19-Short-beaked-echidna.jpg'

This addresses issue niumoo#25: add short description to image names.
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.

1 participant