fix: tall originals no longer stop the image variants job
A width whose variant would be taller than the thumbnailer's 4096 px edge limit is skipped with a warning and counted, like a width wider than the original, so the job and journal:image-variants go on with the next widths and images.
This commit is contained in:
@@ -192,6 +192,14 @@ func GenerateImageVariants(ctx context.Context, db *gorm.DB, bucket *blob.Bucket
|
||||
continue
|
||||
}
|
||||
h := max(1, int((int64(sh)*int64(w)+int64(sw)/2)/int64(sw)))
|
||||
if h > MaxImageWidth {
|
||||
// A tall original (an infographic): the variant would leave
|
||||
// the thumbnailer's edge limit, so this width is skipped like
|
||||
// one wider than the original, and the job goes on.
|
||||
variantsLog.Warn("journal: no image variant taller than the edge limit", "file", f.ID, "width", w, "height", h, "max", MaxImageWidth)
|
||||
out.Skipped++
|
||||
continue
|
||||
}
|
||||
key, err := f.ThumbKey(ctx, bucket, w, h, ImageVariantsMode)
|
||||
if err != nil {
|
||||
return out, fmt.Errorf("journal: thumbnail %d at %d: %w", f.ID, w, err)
|
||||
|
||||
Reference in New Issue
Block a user