Repository navigation
feat: 一覧のカード用に横幅で揃えた派生画像を作れるようにする - #20
Merged
Merged
Conversation
SharpImageProcessor に cardWidth を渡したときだけ card を作る。一覧は横幅で並べるので、 長辺ではなく横幅で揃え、縦に長い画像でも display の長辺は超えない。指定しなければ 今までと同じ結果になり、ImageVariants の card は省略できるので、既存の実装や fake は そのまま動く。 cardWidth を使う前に作った画像のために、保存済みの display から card を作る createCardVariant も出す。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
何を変えるか
@lumorphia/mediaに、一覧のカード用の派生画像cardを足す。SharpImageProcessorにcardWidthを渡したときだけcardを作る。一覧は横幅で並べるので、長辺ではなく横幅で揃える。縦に長い画像でも display の長辺 (既定 2048px) は超えない。拡大はしないImageVariants.cardは省略できる。指定しなければ今までと同じ結果になり、サービス側の fake のImageProcessorもそのまま動く (minor)createCardVariant(bytes, width)を出す。cardWidthを使う前に作った画像の作り直し用なぜ
Prismtone の一覧を誌面のデザインにしてから、カードの表示幅が 345〜465px (CSS px)、トップのメイン写真は約 860px になった。thumb (長辺 512px) では、高精細の画面で 1.5〜3.4 倍に引き伸ばされてぼやける。display (2048px) を一覧に使うと転送量が大きすぎるので、その間の大きさを用意する。経緯は prismtone 側の ADR に書く。
確かめたこと
pnpm lint && pnpm format:check && pnpm typecheck && pnpm testが通る🤖 Generated with Claude Code