Cropping a referenced image

Sannyasin Brahmanathaswami brahma at hindu.org
Tue Aug 14 10:55:06 EDT 2018


[sending this again, because it was rolled in another thread/conversation by the mail list}

#test

on mouseup

put the long id of img "thumbTemplate" into pImage

put the loc of pImage into pLocation

set the filename of pImage to "https://i.ytimg.com/vi/KO3l3-4pFyo/default.jpg"<https://i.ytimg.com/vi/KO3l3-4pFyo/default.jpg><https://i.ytimg.com/vi/KO3l3-4pFyo/default.jpg><https://i.ytimg.com/vi/KO3l3-4pFyo/default.jpg>


--set the filename of pImage to "https://i.ytimg.com/vi/KO3l3-4pFyo/hqdefault.jpg"<https://i.ytimg.com/vi/KO3l3-4pFyo/hqdefault.jpg><https://i.ytimg.com/vi/KO3l3-4pFyo/hqdefault.jpg><https://i.ytimg.com/vi/KO3l3-4pFyo/hqdefault.jpg>

set the loc of pImage to pLocation

end mouseup

USE CASE:

1) eliminate top and bottom letter boxing on YouTube thumbnails. Easy done on web with CSS, not easy in LC
2) They provide a 4x3 by ratio
3) But when you post an HD video, thumbnail is 16x9, letterbox, top and bottom (45 pix of the hqdefault.jpg).
4) All youTube video channel thumbnails are letterboxed -- we don't 4X3 videos, ever...
6) "crop" command does on work with referenced images.
7) Look for a simple method that in the data grid takes up very little CPU time.
8) options
     a) seems like I could make a mask on top the image to eliminate the letterbox.
     b) other options?
9) we could go to the trouble to down load the thumb and crop and store them in /documents (mobile app); but there's no point: the user *has* to have a internet connection to use this module to view YouTube; and the call to https://i.ytimg.com is very fast, so why bother?

 Spotify does a similar thing: it has a generic icon until the album cover is loaded.

Any ideas?  Meanwhile I'll explored masking.

BR



More information about the use-livecode mailing list