Kodi Community Forum

Full Version: Auto-generated thumbs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a conditional that knows the difference between an "auto-generated" thumb, and an thumb that came from a filename.tbn, folder.jpg, or folder.tbn (user generated or scraped, just not pulled from a screengrab)?
As in:
<visible>!IsEmpty(ListItem.Thumb)</visible>

So that normal thumbs (filename.tbn) that are DVD case shape in aspect ratio, can be differentiated from "auto-generated" thumbs that are obviously 4:3 or 16:9 when created by XBMC from basically a screenshot of the media file.

I would like to be able to stretch proper thumbs to the DVD case aspect ratio, but I can't figure out a way to keep the "auto-generated" thumbs from getting squished into the same aspect ratio.

I checked the wiki, and tried every image type there, nothing.
I searched the forums, but it is not an easily search-able question.

Any ideas?
you should be able to do a substring() on the image filename.

auto-generated thumbs all have 'auto-' in their filename.

<visible>SubString(ListItem.Icon,auto)</visible>
Worked perfectly, where did you learn that they have auto- in their names from?

Thank you, by the way.
MacGyver Wrote:Worked perfectly, where did you learn that they have auto- in their names from?

i had a few good looks at the recently added script in the past,
and they use this code:
Code:
# if thumb does not exist use an auto generated thumb path
if ( not os.path.isfile( xbmc.translatePath( thumb ) ) ):
  thumb = "special://profile/Thumbnails/Video/%s/[b]auto-[/b]%s" % ( thumb_cache[ 0 ], thumb_cache, )