Cropping a referenced image

Sannyasin Brahmanathaswami brahma at hindu.org
Tue Aug 14 11:53:32 EDT 2018


Scott Rossi's Method in masking0ption.livecode.

I can copy the group of

an image (car) with ink:blendSrcOver
and graphic ink:blendDstIn

into another stack

it appears fine.  but as soon and I "touch" in group edited, even if you keep them ink params the same, I get not mask! (9.0.1 RC1)

so... LC *can* display the original of  masked image but the IDE "wrecks" it


go stack url "http://wiki.hindu.org/uploads/maskingoptions.livecode"<http://wiki.hindu.org/uploads/maskingoptions.livecode>

BR

On 8/14/18 4:55 AM, Sannyasin Brahmanathaswami via use-livecode wrote:

[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><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><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