thumbnailer icon indicating copy to clipboard operation
thumbnailer copied to clipboard

Thumbnail proportional scaling

Open ElMaxo opened this issue 5 years ago • 1 comments

Hello There is no convenient way to create proportionally scaled thumbnails now. We can't get original size thumbnail, because default thumbnail dimensions will be set as 150*150. Also, we can't perform custom processing by manual ffmpeg context creation, because many file types failed to open without mime type specification, but mime type can be specified only at private method. Please, take a look at https://github.com/ElMaxo/thumbnailer/blob/master/thumbnailer.go#L105. I think this is a good solution. Also, proportional scaling can be added by height, not only by width.

ElMaxo avatar Feb 09 '21 10:02 ElMaxo

There is no convenient way to create proportionally scaled thumbnails now. https://github.com/ElMaxo/thumbnailer/blob/master/thumbnailer.go#L105

150x150 or anything you set is only the bounding box (I now see the docs are not too clear about this). The actual thumbnail dimensions are calculated here https://github.com/bakape/thumbnailer/blob/master/thumbnailer.c#L327-L335 If I understand correctly, what you need is to only scale by one dimension? That can be easily achieved by setting the dimension you don't want to scale by to a large number like math.MaxUint32.

we can't perform custom processing by manual ffmpeg context creation

What exactly do you need to do?

mime type can be specified only at private method

You can register more functions for MIME type detection with https://pkg.go.dev/github.com/bakape/thumbnailer#RegisterMatcher

bakape avatar Feb 10 '21 22:02 bakape