Skip to content

fix: fallback missing realm card image#1444

Open
SameDesu123 wants to merge 1 commit into
kwaroran:mainfrom
SameDesu123:fix/realm-none-webp-fallback
Open

fix: fallback missing realm card image#1444
SameDesu123 wants to merge 1 commit into
kwaroran:mainfrom
SameDesu123:fix/realm-none-webp-fallback

Conversation

@SameDesu123
Copy link
Copy Markdown
Contributor

PR Checklist

  • Required Checks
    • Have you added type definitions?
    • Have you tested your changes?
    • Have you checked that it won't break any existing features?
  • If your PR uses models1, check the following:
    • Have you checked if it works normally in all models?
    • Have you checked if it works normally in all web, local, and node-hosted versions? If it doesn't, have you blocked it in those versions?
  • If your PR is highly AI generated2, check the following:
    • Have you understood what the code does?
    • Have you cleaned up any unnecessary or redundant code?
    • Is it not a huge change?

Summary

Adds a fallback image for character card exports when the character has no readable avatar image.

Related Issues

None

Changes

  • Added a character card export image resolver that first tries the character image.
  • Falls back to /none.webp when the character image is missing, empty, or unreadable.
  • Keeps the fallback limited to export/upload output without mutating the character or database image field.

Impact

Realm uploads and character card exports no longer fail solely because a bot card has no profile image. Existing characters with valid images continue to export with their original image.

Additional Notes

Validated with pnpm check.
Test it manually in dev server.

Footnotes

  1. Modifies the behavior of prompting, requesting, or handling responses from AI models.

  2. Over 80% of the code is AI generated.

Copy link
Copy Markdown
Collaborator

@cubicj cubicj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the export path. This reuses the existing /none.webp placeholder for missing card images without mutating the character data.

Check, tests, and build pass locally.

Approving — thanks for the contribution!

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