Creating movie thumbnail

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
SEAL29
Posts: 61
Joined: Fri Oct 02, 2020 3:32 pm

Creating movie thumbnail

Post by SEAL29 » Sun Apr 11, 2021 6:44 pm

I have 35 different full hd images (snapshots) from movie and i want to make an app that puts these images together in a 7x5 thumbnail.
i use this code

Code: Select all

...
   ## Create images
   ##01
   create image "pic1"
   set the filename of img "pic1" to tPath & tSnap1 & tType
   ##02
   create image "pic2"
   set the filename of img "pic2" to tPath & tSnap2 & tType
   ##03
   create image "pic3"
   set the filename of img "pic3" to tPath & tSnap3 & tType
   ##04
   create image "pic4"
   set the filename of img "pic4" to tPath & tSnap4 & tType
   ##05
   create image "pic5"
   set the filename of img "pic5" to tPath & tSnap5 & tType
   ##06
   create image "pic6"
   set the filename of img "pic6" to tPath & tSnap6 & tType
   ##07
   create image "pic7"
   set the filename of img "pic7" to tPath & tSnap7 & tType
   ##08
   create image "pic8"
   set the filename of img "pic8" to tPath & tSnap8 & tType
   ##09
   create image "pic9"
   set the filename of img "pic9" to tPath & tSnap9 & tType
   ##10
   create image "pic10"
   set the filename of img "pic10" to tPath & tSnap10 & tType
   ##11
   create image "pic11"
   set the filename of img "pic11" to tPath & tSnap11 & tType
   ##12
   create image "pic12"
   set the filename of img "pic12" to tPath & tSnap12 & tType
   ##13
   create image "pic13"
   set the filename of img "pic13" to tPath & tSnap13 & tType
   ##14
   create image "pic14"
   set the filename of img "pic14" to tPath & tSnap14 & tType
   ##15
   create image "pic15"
   set the filename of img "pic15" to tPath & tSnap15 & tType
   ##16
   create image "pic16"
   set the filename of img "pic16" to tPath & tSnap16 & tType
   ##17
   create image "pic17"
   set the filename of img "pic17" to tPath & tSnap17 & tType
   ##18
   create image "pic18"
   set the filename of img "pic18" to tPath & tSnap18 & tType
   ##19
   create image "pic19"
   set the filename of img "pic19" to tPath & tSnap19 & tType
   ##20
   create image "pic20"
   set the filename of img "pic20" to tPath & tSnap20 & tType
   ##21
   create image "pic21"
   set the filename of img "pic21" to tPath & tSnap21 & tType
   ##22
   create image "pic22"
   set the filename of img "pic22" to tPath & tSnap22 & tType
   ##23
   create image "pic23"
   set the filename of img "pic23" to tPath & tSnap23 & tType
   ##24
   create image "pic24"
   set the filename of img "pic24" to tPath & tSnap24 & tType
   ##25
   create image "pic25"
   set the filename of img "pic25" to tPath & tSnap25 & tType
   ##26
   create image "pic26"
   set the filename of img "pic26" to tPath & tSnap26 & tType
   ##27
   create image "pic27"
   set the filename of img "pic27" to tPath & tSnap27 & tType
   ##28
   create image "pic28"
   set the filename of img "pic28" to tPath & tSnap28 & tType
   ##29
   create image "pic29"
   set the filename of img "pic29" to tPath & tSnap29 & tType
   ##30
   create image "pic30"
   set the filename of img "pic30" to tPath & tSnap30 & tType
   ##31
   create image "pic31"
   set the filename of img "pic31" to tPath & tSnap31 & tType
   ##32
   create image "pic32"
   set the filename of img "pic32" to tPath & tSnap32 & tType
   ##33
   create image "pic33"
   set the filename of img "pic33" to tPath & tSnap33 & tType
   ##34
   create image "pic34"
   set the filename of img "pic34" to tPath & tSnap34 & tType
   ##35
   create image "pic35"
   set the filename of img "pic35" to tPath & tSnap35 & tType
   ## Putting sizes
   put the imagedata of img "1" & the imagedata of img "2" & the imagedata of img "3" & the imagedata of img "4" & the imagedata of img "5" & \ 
         the imagedata of img "6" & the imagedata of img "7" & the imagedata of img "8" & the imagedata of img "9" & the imagedata of img "10" & the imagedata of img "11" & \
         the imagedata of img "12" & the imagedata of img "13" & the imagedata of img "14" & the imagedata of img "15" & the imagedata of img "16" & the imagedata of img "17" & \
         the imagedata of img "18" & the imagedata of img "19" & the imagedata of img "20" & the imagedata of img "21" & the imagedata of img "22" & the imagedata of img "23" & \
         the imagedata of img "24" & the imagedata of img "25" & the imagedata of img "26" & the imagedata of img "27" & the imagedata of img "28" & the imagedata of img "29" & \
         the imagedata of img "30" & the imagedata of img "31" & the imagedata of img "32" & the imagedata of img "33" & the imagedata of img "34" & the imagedata of img "35" into myData
   put the width of image "1" into tWidth1
   put the height of image "1" into tHeight1
   put the width of image "2" into tWidth2
   put the height of image "2" into tHeight2
   put the width of image "3" into tWidth3
   put the height of image "3" into tHeight3
   put the width of image "4" into tWidth4
   put the height of image "4" into tHeight4
   put the width of image "5" into tWidth5
   put the height of image "5" into tHeight5
   put the width of image "6" into tWidth6
   put the height of image "6" into tHeight6
   put the width of image "7" into tWidth7
   put the height of image "7" into tHeight7
   put the width of image "8" into tWidth8
   put the height of image "8" into tHeight8
   put the width of image "9" into tWidth9
   put the height of image "9" into tHeight9
   put the width of image "10" into tWidth10
   put the height of image "10" into tHeight10
   put the width of image "11" into tWidth11
   put the height of image "11" into tHeight11
   put the width of image "12" into tWidth12
   put the height of image "12" into tHeight12
   put the width of image "13" into tWidth13
   put the height of image "13" into tHeight13
   put the width of image "14" into tWidth14
   put the height of image "14" into tHeight14
   put the width of image "15" into tWidth15
   put the height of image "15" into tHeight15
   put the width of image "16" into tWidth16
   put the height of image "16" into tHeight16
   put the width of image "17" into tWidth17
   put the height of image "17" into tHeight17
   put the width of image "18" into tWidth18
   put the height of image "18" into tHeight18
   put the width of image "19" into tWidth19
   put the height of image "19" into tHeight19
   put the width of image "20" into tWidth20
   put the height of image "20" into tHeight20
   put the width of image "21" into tWidth21
   put the height of image "21" into tHeight21
   put the width of image "22" into tWidth22
   put the height of image "22" into tHeight22
   put the width of image "23" into tWidth23
   put the height of image "23" into tHeight23
   put the width of image "24" into tWidth24
   put the height of image "24" into tHeight24
   put the width of image "25" into tWidth25
   put the height of image "25" into tHeight25
   put the width of image "26" into tWidth26
   put the height of image "26" into tHeight26
   put the width of image "27" into tWidth27
   put the height of image "27" into tHeight27
   put the width of image "28" into tWidth28
   put the height of image "28" into tHeight28
   put the width of image "29" into tWidth29
   put the height of image "29" into tHeight29
   put the width of image "30" into tWidth30
   put the height of image "30" into tHeight30
   put the width of image "31" into tWidth31
   put the height of image "31" into tHeight31
   put the width of image "32" into tWidth32
   put the height of image "32" into tHeight32
   put the width of image "33" into tWidth33
   put the height of image "33" into tHeight33
   put the width of image "34" into tWidth34
   put the height of image "34" into tHeight34
   put the width of image "35" into tWidth35
   put the height of image "35" into tHeight35
   --set the dimensions of the combined image, one on top of the other
   put tWidth1 + tWidth6 + tWidth11 + tWidth16 + tWidth21 + tWidth26 + tWidth31 into tMaxWidth
   put tHeight1 into tMaxHeight
   create img "36"
   set the width of image "36" to tMaxWidth
   set the height of image "36" to tMaxHeight
   set the imagedata of img "36" to myData
   set the resizequality of img "36" to "best"
   set the rect of img "36" to "7,53,1894,815"
   ...
so i get a 7x7 thubmnail each column has the same 7 images.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9356
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Creating movie thumbnail

Post by richmond62 » Sun Apr 11, 2021 8:27 pm

Once you know what the thumbnails' dimensions are
you can simply line them up . . . using either set or move.
-
Thumbnailer.jpg
-

Code: Select all

on mouseUp
   set the topleft of img "t1" to 10,100
   set the topleft of img "t2" to 340,100
   set the topleft of img "t3" to 670,100
   set the topleft of img "t4" to 10, 282
   set the topleft of img "t5" to 340, 282
   set the topleft of img "t6" to 670, 282
end mouseUp
https://www.dropbox.com/s/y4ewg316puqld ... e.zip?dl=0

jiml
Posts: 336
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: Creating movie thumbnail

Post by jiml » Mon Apr 12, 2021 6:47 pm

SEAL29

The REPEAT structure can help shorten code.

Code: Select all

repeat with x = 1 to 35
  set the filename of img ("pic" & x) to tPath & (tSnap & x) & tType
end repeat

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”