Forhåndsvisning
Photo collage
Notes/Limitations
- 100% native shortcut painstakingly adapted from my Python version, requires no other apps/shortcuts to run
- It's slow when many images are used (50+ images will take several minutes; 100+ images will take 15-20 minutes, which, yes, is rediculous)
- If you want more speed, check out the Python and Pythonista (iOS) versions on my GitHub that run over 100X faster
- On iOS, Photo collage can fail if too much memory is used
-
- If this happens, use the included "Preprocess images" utility which creates downscaled copies of images in a new photo album, then rerun Photo collage with those images
-
- It will also run faster if preprocessing is done first
- Can run by sharing images from the Share Sheet (works better with Siri Shortcut than with Pythonista version)
- On macOS, sharing images from Photos to a Shortcut doesn't work (thanks, Apple....)
Interface
- Run the shortcut from within the Shortcuts app, from a widget, or using the Share Sheet to share photos directly from a photo app (Photos/Google Photos/etc)
- Select options for the collage and then select “Continue”
- The collage will be generated and previewed, and you then have options to save and/or make a new collage from the same batch of selected images
- The shortcut supports using 1 or 2 levels of nesting. The reason to use more than one level of nesting is to get a more dynamic collage, and with greater size difference between the smallest and largest images in the collage.
Features
See the screenshots for features
Credits
- Thanks to @gluebyte for Join Shortcuts, necessary for developing this shortcut by allowing for the independent development of subroutines
- Thanks to @Avieshek for the Update Engine used for update checking
How it works
Read about how it works here
Nyheder
Version 1.0
First release
Hvad den gør
946 handlinger-
CommentPhoto collage Tim Wilson, January 2024 Creates a proper photo collage from 2 or more images. Adapted from my Python (and Pythonista) script at https://github.com/twilsonco/PyPhotoCollage
-
Comment<===== BEGIN CONFIGURATION =====> The following options control how nested collages work.
-
CommentSet the maximum number of nested collages. This option overrides those that follow.
-
Number
-
CommentDefine min and max number of images used for nested collages. Only takes effect if the number of total images is ≥ 3 times the min size. If too low a min is used, there will be no nesting. If too low a max is used, it will limit the nesting depth (i…
-
Number
-
Number
-
CommentDefine min and max aspect ratio bounds for sub-collages, which are chosen at random.
-
Number
-
Number
-
Comment<===== END CONFIGURATION =====>
-
Set VariableMax recursion depth
-
Set VariableMin batch size
-
Set VariableMax batch size
-
Calculate
-
Calculate
-
Get Device Details
-
Number
-
Number
-
CommentSet debug printing to True (1) to log detailed shortcut activity to iCloud/Shortcuts/PhotoCollage/log.txt
-
Text
-
Set VariableDebugPrinting
-
CommentDebug option to put colored outlines on each image to indicate which level of recursion was used to process it
-
Set VariableDoColorByDepth
-
Set VariableOutput image directly
-
Set VariableRecursionDepth
-
Set VariableCheckFunctionArgs
-
CommentFunctions used when calling shortcut recursively, taking a dictionary as input
-
Get Dictionary from Input
-
Set VariableInDict
-
Get Dictionary Value
-
Set VariableFunctionName
-
If
-
CommentGet user options
-
If
-
CommentGet options from the user. First define default options
-
Get Device Details
-
If
-
Number
-
If
-
Number
-
Set VariableMaxDim
-
CommentPrepare menu prompt. Include in prompt for iOS users to use the “prepare images” tool if they have problems.
-
Text
-
Set VariablePrompt
-
Number
-
Number
-
Nothing
-
Dictionary
-
Set VariableOptionDict
-
Count
-
Calculate
-
Repeat
-
Set VariableOptionMenu
-
Repeat
-
Get Dictionary Value
-
Get Dictionary Value
-
Set VariableShow
-
If
-
If
-
If
-
Set VariableShow
-
If
-
Count
-
If
-
Text
-
If
-
Text
-
Add to Variable
-
Choose from List
-
CommentSplitting by em-space “ “
-
Split Text
-
Get Item from List
-
Get Dictionary Value
-
Get Dictionary Value
-
Set VariableDoReturn
-
If
-
Set VariableDoReturn
-
If
-
Set VariableDoReturn
-
If
-
Set Dictionary Value
-
Set Dictionary Value
-
Set VariableOptionDict
-
Set VariableOutDict
-
Repeat
-
Get Dictionary Value
-
Set Dictionary Value
-
Set VariableOutDict
-
Stop and Output
-
Get Dictionary Value
-
Get Dictionary Value
-
Get Dictionary Value
-
Get Dictionary Value
-
If
-
Set VariableOptionList
-
Repeat with Each
-
Get Dictionary Value
-
Text
-
Add to Variable
-
Text
-
Add to Variable
-
Text
-
Choose from List
-
CommentSplitting by em-space “ “
-
Split Text
-
Get Item from List
-
If
-
Get Dictionary Value
-
Set VariableAllow decimal
-
If
-
If
-
Text
-
If
-
Text
-
Ask for Input…
-
If
-
List
-
Calculate Statistics
-
List
-
Calculate Statistics
-
If
-
List
-
Calculate Statistics
-
If
-
Number
-
If
-
Round Number
-
If
-
Set Dictionary Value
-
Set Dictionary Value
-
Set VariableOptionDict
-
CommentInitialize 2d array
-
If
-
CommentInitialize a 2d array to the specified value. Arguments (name, type, required/optional, notes): fname: string, required, must be “Initialize 2d array” nrows: integer, required, must be > 0 ncols: integer, required, must be > 0 initval: optional, def…
-
Get Dictionary Value
-
Get Dictionary Value
-
If
-
Get Dictionary Value
-
If
-
Number
-
Set VariableInitVal
-
If
-
If
-
Show Result
-
Stop This Shortcut
-
If
-
Show Result
-
Stop This Shortcut
-
If
-
Show Result
-
Stop This Shortcut
-
If
-
Show Result
-
Stop This Shortcut
-
Nothing
-
Set VariableOutArray
-
Repeat
-
Set VariableCol
-
Repeat
-
Set Dictionary Value
-
Set VariableCol
-
Set Dictionary Value
-
Set VariableOutArray
-
Stop and Output
-
CommentSet 2d array element
-
If
-
CommentSet the value of the element at (i, j) in the provided 2d array to the specified value. Arguments (name, type, required/optional, notes): fname: string, required, must be “Set 2d array element” array: 2d array (dictionary) made with “Initialize 2d a…
-
Get Dictionary Value
-
Get Dictionary Value
-
Get Dictionary Value
-
Get Dictionary Value
-
If
-
If
-
Count
-
Get Dictionary Value
-
Count
-
If
-
Show Result
-
Stop This Shortcut
-
If
-
Show Result
-
Stop This Shortcut
-
If
-
Show Result
-
Stop This Shortcut
-
If
-
Show Result
-
Stop This Shortcut
-
If
-
Show Result
-
Stop This Shortcut
-
If
-
Show Result
-
Stop This Shortcut
-
Get Dictionary Value
-
Set Dictionary Value
-
Set Dictionary Value
-
Stop and Output
-
CommentGet index of list item
Vis som kode
Alle genvejens handlinger skrevet ud i Cherri, et programmeringssprog til genveje. Perfekt til at lære, hvordan den virker.
#include 'actions/photos'
#include 'actions/math'
#include 'actions/device'
#define color teal
#define glyph photoStackAlt
/*
Photo collage
Tim Wilson, January 2024
Creates a proper photo collage from 2 or more images. Adapted from my Python (and Pythonista) script at https://github.com/twilsonco/PyPhotoCollage
*/
/*
<===== BEGIN CONFIGURATION =====>
The following options control how nested collages work.
*/
// Set the maximum number of nested collages. This option overrides those that follow.
const MaxRecursionDepthDefault = 2
/*
Define min and max number of images used for nested collages. Only takes effect if the number of total images is ≥ 3 times the min size. If too low a min is used, there will be no nesting. If too low a max is used, it will limit the nesting depth (i.e. how many nested collages can be nested inside other nested collages).
*The max value is multiplied by the max recursion level to allow for deeper nesting.
*/
// Define min and max aspect ratio bounds for sub-collages, which are chosen at random.
const MinARIn = 0.5
const MaxARIn = 2
// <===== END CONFIGURATION =====>
@MaxRecursionDepth = MaxRecursionDepthDefault
@MinBatchSize = MinBatchSizeIn
@MaxBatchSize = MaxBatchSizeIn
const MinARX100 = MinARIn * 100
const MaxARX100 = MaxARIn * 100
const DeviceModel1 = getDeviceDetail("Device Model")
// Set debug printing to True (1) to log detailed shortcut activity to iCloud/Shortcuts/PhotoCollage/log.txt
const LogfileName = "/PhotoCollage/log.txt"
@DebugPrinting = False
// Debug option to put colored outlines on each image to indicate which level of recursion was used to process it
@DoColorByDepth = False
@OutputImageDirectly = False
@RecursionDepth = False
@CheckFunctionArgs = True
// Functions used when calling shortcut recursively, taking a dictionary as input
@InDict = getDictionary(ShortcutInput)
@FunctionName = @InDict['fname']
if @FunctionName {
// Get user options
if @FunctionName == "Get options" {
// Get options from the user. First define default options
const DeviceModel = getDeviceDetail("Device Model")
if DeviceModel == "Mac" {
} else {
}
@MaxDim = 9000
// Prepare menu prompt. Include in prompt for iOS users to use the “prepare images” tool if they have problems.
@Prompt = "Configure options or preprocess images if it fails"
nothing()
@OptionDict = {
"1": {
"Description": "Create simple or composite (nested) collage?",
"Icon": "⊞",
"Name": "Collage type",
"Options": {
"Nested (1)": "⧈",
"Nested (2)": "⧈",
"Simple by columns": "⎅",
"Simple by rows": "⏛"
},
"Value": "Nested (1)"
},
"10": {
"Icon": "✔︎",
"Name": "Continue",
"Value": ""
},
"2": {
"Description": "How should selected images be ordered in the collage?",
"Icon": "⇅",
"Name": "Image order",
"Options": {
"Input order": "➲",
"Newest first": "↥",
"Oldest first": "↧",
"Shuffle": "⤨"
},
"Value": "Input order"
},
"3": {
"Allow decimal": false,
"Description": "Enter the gap between images, in pixels",
"Icon": "╬",
"Min": 0,
"Name": "Image spacing",
"Unit": " px",
"Value": 30
},
"4": {
"Allow decimal": false,
"Description": "Specify image corner rounding as a percentage of shortest edge.",
"Icon": "⎄",
"Max": 100,
"Min": 0,
"Name": "Round image corners",
"Unit": "%",
"Value": 0
},
"5": {
"Allow decimal": false,
"Description": "Specify collage corner rounding as a percentage of shortest edge.",
"Icon": "⎄",
"Mac only": false,
"Max": 100,
"Min": 0,
"Name": "Round collage corners",
"Unit": "%",
"Value": 0
},
"6": {
"Description": "Randomly rotate (jitter) images within this amount",
"Icon": "⟲",
"Max": 90,
"Min": 0,
"Name": "Image rotation",
"Unit": " deg",
"Value": 0
},
"7": {
"Allow decimal": true,
"Description": "Set the target aspect ratio of the collage. Increase to make it wider, decrease to make it narrower.",
"Icon": "⧉",
"Min": "0.001",
"Name": "Target aspect ratio",
"Value": "1.0"
},
"8": {
"Allow decimal": false,
"Description": "Set the maximum dimension (width or height) of the output collage in pixels.",
"Icon": "⁜",
"Max": "{@MaxDim}",
"Min": 100,
"Name": "Collage max width/height",
"Unit": " px",
"Value": 5000
},
"9": {
"Icon": "⚙︎",
"Name": "Preprocess images",
"Value": ""
}
}
const NumOptions = count(@OptionDict)
const NumRepeat = NumOptions * 3
repeat _ for NumRepeat {
@OptionMenu
repeat _ for NumOptions {
const DictionaryValue = getValue(@OptionDict, @RepeatIndex2)
const MacOnly = getValue(DictionaryValue, "Mac only")
@Show = True1
if MacOnly {
if MacOnly == {
if DeviceModel != "Mac" {
@Show = False1
}
}
}
if @Show == {
const Count = count(DictionaryValue['Value'], "Characters")
if Count > 0 {
} else {
}
@OptionMenu += "{@RepeatIndex2} {DictionaryValue['Icon']} {DictionaryValue['Name']}"
}
}
const ChosenItem = chooseFromList(@OptionMenu, @Prompt)
// Splitting by em-space “ “
const SplitText = splitText(ChosenItem, " ")
const OptionNumber = getListItem(SplitText, 0)
const ChosenOption = getValue(@OptionDict, OptionNumber)
const Name = getValue(ChosenOption, "Name")
@DoReturn = False1
if Name contains "Preprocess" {
@DoReturn = True1
}
if Name contains "Continue" {
@DoReturn = True1
}
if @DoReturn == "Continue" {
setValue(ChosenOption, "Value", True1)
setValue(@OptionDict, OptionNumber)
@OptionDict
@OutDict
repeat _ for NumOptions {
setValue(@OutDict, ['Name'], ['Value'])
@OutDict
}
output(@OutDict)
}
const Options = getValue(ChosenOption, "Options")
const Value = getValue(ChosenOption, "Value")
const Min = getValue(ChosenOption, "Min")
const Max = getValue(ChosenOption, "Max")
if Options {
@OptionList
for _ in Options['Keys'] {
const Icon = Options[@RepeatItem2]
@OptionList += "{Icon} {@RepeatItem2}"
}
@OptionList += "↺ Go back"
const ChosenItem1 = chooseFromList(@OptionList)
// Splitting by em-space “ “
const SplitText1 = splitText(ChosenItem1, " ")
getLastItem(SplitText1)
} else {
@AllowDecimal = ChosenOption['Allow decimal']
if Min {
if Max {
} else {
}
prompt(, "Number")
if Max {
const List = list(, Max)
statistic("Minimum", nil)
const List1 = list(, Min)
statistic("Maximum", nil)
} else {
const List2 = list(, Min)
statistic("Maximum", nil)
}
}
if @AllowDecimal == {
number(IfResult)
} else {
round(IfResult)
}
}
if IfResult1 !contains "Go back" {
setValue(ChosenOption, "Value", IfResult1)
setValue(@OptionDict, OptionNumber)
@OptionDict
}
}
}
// Initialize 2d array
if @FunctionName == "Initialize 2d array" {
/*
Initialize a 2d array to the specified value.
Arguments (name, type, required/optional, notes):
fname: string, required, must be “Initialize 2d array”
nrows: integer, required, must be > 0
ncols: integer, required, must be > 0
initval: optional, defaults to 0
*/
const nRows = getValue(@InDict, "nrows")
const nCols = getValue(@InDict, "ncols")
if @InDict {
} else {
}
@InitVal = 0
if @CheckFunctionArgs == {
if !nRows {
show("Initialize 2d array error: nRows not provided")
stop()
}
if nRows < 1 {
show("Initialize 2d array error: nRows must be greater than 0")
stop()
}
if !nCols {
show("Initialize 2d array error: nCols not provided")
stop()
}
if nCols < 1 {
show("Initialize 2d array error: nCols must be greater than 0")
stop()
}
}
nothing()
@OutArray
repeat _ for nRows {
@Col
repeat _ for nCols {
setValue(@Col, @RepeatIndex2, @InitVal)
@Col
}
setValue(@OutArray, @RepeatIndex, @Col)
@OutArray
}
output(@OutArray)
}
// Set 2d array element
if @FunctionName == "Set 2d array element" {
/*
Set the value of the element at (i, j) in the provided 2d array to the specified value.
Arguments (name, type, required/optional, notes):
fname: string, required, must be “Set 2d array element”
array: 2d array (dictionary) made with “Initialize 2d array”, required
i: integer, required, must be 0 > irow ≥ nrows
j: integer, required, must be 0 > icol ≥ ncols
val: any, required
*/
const Array = getValue(@InDict, "array")
const i = getValue(@InDict, "i")
const j = getValue(@InDict, "j")
const Val = getValue(@InDict, "val")
if @CheckFunctionArgs == {
if Array {
const nRows1 = count(Array['Keys'])
const FirstRow = getValue(Array, "1")
const nCols1 = count(FirstRow['Keys'])
} else {
show("Set 2d array element error: no array provided")
stop()
}
if i < 1 {
show("Initialize 2d array error: i must be greater than 0")
stop()
}
if i > nRows1 {
show("Initialize 2d array error: i is greater than nRows ({nRows1})")
stop()
}
if j < 1 {
show("Initialize 2d array error: j must be greater than 0")
stop()
}
if j > nCols1 {
show("Initialize 2d array error: j is greater than nCols ({nCols1})")
stop()
}
if !Val {
show("Initialize 2d array error: val not provided")
stop()
}
}
const DictionaryValue1 = getValue(Array, i)
setValue(DictionaryValue1, j, Val)
setValue(Array, i)
output()
}
// Get index of list item
if @FunctionName == "Get index of list item" {
/*
Return the 1-based index of the element in a list matching the specified value, or -1 if not found.
Arguments (name: type, required/optional, notes):
fname: string, required, must be “Get index of list item”
list: list, required
val: any, required
*/
const List3 = getValue(@InDict, "list")
const Val1 = getValue(@InDict, "val")
if @CheckFunctionArgs == {
if !List3 {
show("Get index of list item\n error: list not provided")
stop()
}
if !Val1 {
show("Get index of list item\n error: val not provided")
stop()
}
}
for _ in List3 {
if @RepeatItem == Val1 {
output(@RepeatIndex)
}
}
output("-1")
}
// Get shuffled order
if @FunctionName == "Get shuffled order" {
/*
Return a list of integers in shuffled order
Arguments (name, type, required/optional, notes):
fname: string, required, must be “Get shuffled order”
n: integer number defining the list size, required
*/
const n = getValue(@InDict, "n")
if @CheckFunctionArgs == {
if n < 1 {
show("Get shuffled order error: n must be greater than 0")
stop()
}
}
repeat _ for n {
@AvailableNumbers = @RepeatIndex
}
repeat _ for n {
const ItemFromList = getRandomItem(@AvailableNumbers)
@OutList = ItemFromList
@AvailableNumbers1 = @AvailableNumbers
@AvailableNumbers
for _ in @AvailableNumbers1 {
if @RepeatItem2 != ItemFromList {
@AvailableNumbers = @RepeatItem2
}
}
}
output(@OutList)
}
// Create batches
if @FunctionName == "Create batches" {
/*
Take list of items and create batches with specified min/max sizes. Leftover items that don’t fit into a batch are added as individual batches. Returns a List of lists (batches).
Arguments (name, type, required/optional, notes):
fname: string, required, must be “Create batches”
n: integer number of items to be put into batches, required
sizemin: minimum batch size, required
sizemax: maximum batch size, required
*/
const n1 = getValue(@InDict, "n")
const sizemin = getValue(@InDict, "sizemin")
const sizemax = getValue(@InDict, "sizemax")
if @CheckFunctionArgs == {
if !n1 {
show("Create batches error: n not provided")
stop()
}
if !sizemin {
show("Initialize 2d array error: no sizemin provided")
stop()
}
if !sizemin {
show("Create batches error: no sizemax provided")
stop()
}
if sizemax <= sizemin {
show("Create batches error: sizemin is not less than sizemax")
stop()
}
}
nothing()
const SizeMid = (0.7*sizemin+0.3*sizemax)
@CurCount = 0
@CurBatchNum
repeat _ for n1 {
@list = @RepeatIndex
}
repeat _ for n1 {
@CurBatchNum = @CurBatchNum + 1
const NumRemaining = n1 - @CurCount
if NumRemaining == 0 {
// Batches are created, but it’s a problem that all the single-item batches are at the end of the list of batches. So shuffle the order of batches and then go in and restore the order of the batch items, such the first batch has items 1, 2, 3, etc. and the second has 4, 5, 6, etc.
count(@Batches)
const Dictionary = {
"fname": "Get shuffled order",
"n": "{}"
}
const ShuffledBatchOrder = runSelf(Dictionary)
@OutBatches
@OutCount
for _ in ShuffledBatchOrder {
const DictionaryValue2 = getValue(@Batches, @RepeatItem2)
const Count2 = count(DictionaryValue2)
@OutList
repeat _ for Count2 {
@OutList += @RepeatIndex3 + @OutCount
}
setValue(@OutBatches, @RepeatIndex2, @OutList)
@OutBatches
@OutCount = @OutCount + Count2
}
output(@OutBatches)
}
if NumRemaining < SizeMid {
@CurCount = @CurCount + 1
getListItem(@list, @CurCount)
list()
setValue(@Batches, @CurBatchNum)
@Batches
} else {
@CurBatch
const CalculationResult = min(NumRemaining,sizemax)
const BatchSize = randomNumber(sizemin, CalculationResult)
repeat _ for BatchSize {
const CalculationResult1 = @RepeatIndex2 + @CurCount
getListItem(@list, CalculationResult1)
@CurBatch
}
setValue(@Batches, @CurBatchNum, @CurBatch)
@Batches
@CurCount = @CurCount + BatchSize
}
}
}
// Linear partition problem
if @FunctionName == "Linear partition" {
/*
Implements the python function in the below comment.
Arguments (name: type, required/optional, notes):
fname: string, required, must be “Linear partition”
seq: list of image aspect ratios, required
nrows: integer number of rows in the collage, required
*/
/*
def linear_partition_table(seq, k):
n = len(seq)
table = [[0] * k for x in range(n)]
solution = [[0] * (k-1) for x in range(n-1)]
for i in range(n):
table[i][0] = seq[i] + (table[i-1][0] if i else 0)
for j in range(k):
table[0][j] = seq[0]
for i in range(1, n):
for j in range(1, k):
table[i][j], solution[i-1][j-1] = min(
((max(table[x][j-1], table[i][0]-table[x][0]), x) for x in range(i)),
key=itemgetter(0))
return (table, solution)
*/
const Seq = getValue(@InDict, "seq")
const k = getValue(@InDict, "nrows")
if @CheckFunctionArgs == {
if !Seq {
show("Linear partition table error: seq not provided")
stop()
}
if !k {
show("Linear partition table error: nrows not provided")
stop()
}
}
// n = len(seq)
const n2 = count(Seq)
// table = [[0] * k for x in range(n)]
const Dictionary1 = {
"fname": "Initialize 2d array",
"ncols": "{k}",
"nrows": "{n2}"
}
runSelf(Dictionary1)
@Table
// solution = [[0] * (k-1) for x in range(n-1)]
const N1 = n2 - 1
const K1 = k - 1
const Dictionary2 = {
"fname": "Initialize 2d array",
"ncols": "{K1}",
"nrows": "{N1}"
}
runSelf(Dictionary2)
@Solution
/*
for i in range(n):
table[i][0] = seq[i] + (table[i-1][0] if i else 0)
*/
repeat _ for n2 {
if @RepeatIndex == 1 {
} else {
const DictionaryValue3 = getValue(@Table)
}
const ItemFromList1 = getListItem(Seq, @RepeatIndex)
const Dictionary3 = {
"fname": "Set 2d array element",
"i": "{@RepeatIndex}",
"j": 1,
"val": "{}"
}
const Dictionary4 = setValue(Dictionary3, "array", @Table)
runSelf(Dictionary4)
@Table
}
/*
for j in range(k):
table[0][j] = seq[0]
*/
repeat _ for k {
getRandomItem(Seq)
const Dictionary5 = {
"fname": "Set 2d array element",
"i": 1,
"j": "{@RepeatIndex}",
"val": "{}"
}
const Dictionary6 = setValue(Dictionary5, "array", @Table)
runSelf(Dictionary6)
@Table
}
/*
for i in range(1, n):
for j in range(1, k):
table[i][j], solution[i-1][j-1] = min(
((max(table[x][j-1], table[i][0]-table[x][0]), x) for x in range(i)),
key=itemgetter(0))
*/
repeat _ for N1 {
const i1 = @RepeatIndex + 1
repeat _ for K1 {
const j1 = @RepeatIndex2 + 1
// ((max(table[x][j-1], table[i][0]-table[x][0]), x) for x in range(i))
nothing()
@TupleList1
repeat _ for @RepeatIndex {
const Tablex = getValue(@Table, @RepeatIndex3)
const Tablexj1 = Tablex[@RepeatIndex2]
const Tablei = getValue(@Table, i1)
const Tablei0 = getValue(Tablei, "1")
const Tablex0 = getValue(Tablex, "1")
const Tablei0Tablex0 = Tablei0 - Tablex0
const List4 = list(Tablexj1, Tablei0Tablex0)
statistic("Maximum", nil)
@TupleList1
}
statistic("Minimum", nil)
const Dictionary7 = {
"fname": "Get index of list item",
"val": "{}"
}
const Dictionary8 = setValue(Dictionary7, "list", @TupleList1)
const MinIndex = runSelf(Dictionary8)
getListItem(@TupleList1, MinIndex)
const Dictionary9 = {
"fname": "Set 2d array element",
"i": "{i1}",
"j": "{j1}",
"val": "{}"
}
const Dictionary10 = setValue(Dictionary9, "array", @Table)
runSelf(Dictionary10)
@Table
const Dictionary11 = {
"fname": "Set 2d array element",
"i": "{@RepeatIndex}",
"j": "{@RepeatIndex2}",
"val": "{MinIndex}"
}
const Dictionary12 = setValue(Dictionary11, "array", @Solution)
runSelf(Dictionary12)
@Solution
}
}
list(@Table, @Solution)
output()
}
// Photo collage recursive call for nested collage
if @FunctionName == "Photo collage" {
/*
Create a photo collage from the images in the provided dictionary. Return the collage as an image.
Arguments (name, type, required/optional, notes):
fname: string, required, must be “Photo collage”
options: options dict as returned from the “Get options” function, required
images: list of base64 encoded images, required
*/
@OutputImageDirectly = True
const options = getValue(@InDict, "options")
const images = getValue(@InDict, "images")
if @CheckFunctionArgs == {
if !options {
show("Photo collage recursive call error: options not provided")
stop()
}
if !images {
show("Photo collage recursive call error: images not provided")
stop()
}
const Count3 = count(images)
if Count3 < 3 {
show("Photo collage recursive call error: less than 3 images provided")
stop()
}
}
getDictionary(options)
@Options
const DictionaryValue4 = getValue(@Options, "Recursion depth")
if DictionaryValue4 {
@RecursionDepth = DictionaryValue4
}
const DictionaryValue5 = getValue(@Options, "Max recursion depth")
if DictionaryValue5 {
@MaxRecursionDepth = DictionaryValue5
} else {
if @DebugPrinting == {
appendToFile(LogfileName)
}
}
base64Encode(images)
@ImgList
count(@ImgList)
@NumImages
if @DebugPrinting == {
appendToFile(LogfileName)
}
}
} else {
// Fresh run of shortcut, so prepare images and get user options
// Get input images
if @DebugPrinting == {
appendToFile(LogfileName)
}
@ImgList = ShortcutInput
if !@ImgList {
if DeviceModel1 == "Mac" {
menu nil {
item "🏞️ Choose from photo library":
selectPhotos(true)
item "📂 Choose image files":
selectFile(true)
}
} else {
selectPhotos(true)
}
@ImgList
}
@InputImgList = @ImgList
const NumImagesIn = count(@ImgList)
@NumImages = NumImagesIn
if NumImagesIn < 3 {
confirm("Please select 3 or more images")
stop()
}
// Cap number of images that can be used
if DeviceModel1 == "Mac" {
} else {
}
if NumImagesIn > MaxNumImages {
confirm("Maximum {MaxNumImages} images supported on {DeviceModel1}; you selected {NumImagesIn} images")
stop()
}
// Get user options
const Dictionary13 = {
"fname": "Get options"
}
const ShortcutResult = runSelf(Dictionary13)
getDictionary(ShortcutResult)
@Options
const PreprocessImages = getValue(@Options, "Preprocess images")
if PreprocessImages == {
// Preprocess images to smaller size/format and quit shortcut so that it can be run fresh with a lower memory footprint.
const NewAlbumName = "Preprocessed {@NumImages} images - {CurrentDate}"
const UserPrompt = "Please enter the maximum longest edge length for preprocessing photos, in pixels. \n• The smaller the value, the more photos you'll be able to use for a collage. \n• Original photos will not be modified\n• Processed photos will be saved to a new photo album named \\"{NewAlbumName}\"
const ProvidedInput = prompt(UserPrompt, "Number")
for _ in @ImgList {
const ConvertedImage = convertImage(@RepeatItem, "", 0.6267153532608696)
resizeImageByLongestEdge(ConvertedImage, ProvidedInput)
@ProcessedImages
}
if @ProcessedImages {
createAlbum(NewAlbumName, @ProcessedImages)
count(@ProcessedImages)
const ClosingDialog = "Preprocessed images and saved to album \\"{NewAlbumName}\\". Now run this shortcut again pointing to the images in that album."
show(ClosingDialog)
}
stop()
}
}
currentDate()
if @DebugPrinting == {
appendToFile(LogfileName)
}
@Ordering = @Options
@CollageType = @Options
@TargetAR = @Options
@CollageSize = @Options
@CollageSpacing = @Options
@ImageCornerRoundingPercent = @Options
@CollageCornerRoundingPercent = @Options
@ImageRotationMaxDeg = @Options
nothing()
// Set DoRotate based on collage type and recursion depth
if @CollageType contains "Simple" {
if @CollageType contains "columns" {
@DoRotate = True
} else {
@DoRotate = False
}
} else {
if @CollageType contains "1" {
} else {
}
@MaxRecursionDepth = 2
if @RecursionDepth == 0 {
randomNumber(0, 1)
} else {
}
@DoRotate = 0
}
// Update max batch size based on number of input images
@MaxBatchSize = @MaxBatchSize * @MaxRecursionDepth
@MaxBatchSize
// Image conversion/resizing/masking and ordering (below) only needs to be applied for initial call, not on recursive calls. However, rotation is also done for recursive calls.
if @RecursionDepth == 0 {
const CalculationResult2 = @CollageSpacing+@ImageCornerRoundingPercent+@CollageCornerRoundingPercent
if @DebugPrinting == {
appendToFile(LogfileName)
}
@ImgList1
for _ in @ImgList {
const FileExtension = getImageDetail(@RepeatItem, "File Extension")
@TmpImg = @RepeatItem
if @DebugPrinting == {
appendToFile(LogfileName)
}
if CalculationResult2 > 0 {
if FileExtension !contains "png" {
convertImage(@RepeatItem, "PNG", false)
@TmpImg
}
} else {
if FileExtension != "jpeg" {
convertImage(@TmpImg, "", false)
@TmpImg
}
}
// Now resize if longest edge is greater than collage size (bug is preventing evaluating the expression “max(Width,Height)”)
const List5 = list(@TmpImg['Width'], @TmpImg['Height'])
const Maximum = statistic("Maximum", nil)
if Maximum > @CollageSize {
if @DebugPrinting == {
appendToFile(LogfileName)
}
resizeImageByLongestEdge(@TmpImg, @CollageSize)
@TmpImg
}
// Now mask and rotate. The user-specified corner rounding applies based on the percentage of longest image edge
if @ImageCornerRoundingPercent > 0 {
const List6 = list(@TmpImg['Width'], @TmpImg['Height'])
statistic("Minimum", nil)
const AdjCornerRadius = round(/2*@ImageCornerRoundingPercent/100)
if AdjCornerRadius > 0 {
if @DebugPrinting == {
appendToFile(LogfileName)
}
maskImage(@TmpImg, "", AdjCornerRadius)
@TmpImg
}
}
if @ImageRotationMaxDeg > 0 {
const CalculationResult3 = @ImageRotationMaxDeg * -1
const RandomNumber = randomNumber(CalculationResult3, @ImageRotationMaxDeg)
rotateMedia(@TmpImg, RandomNumber)
@TmpImg
}
@ImgList1 = @TmpImg
nothing()
}
@TmpImg
@ImgList = @ImgList1
@ImgList1
// Apply user-selected ordering, one of “Input order”, “Shuffle”, “Oldest first”, “Newest first”
if @Ordering == "Input order" {
} else {
if @Ordering == "Shuffle" {
if @DebugPrinting == {
appendToFile(LogfileName)
}
const Dictionary14 = {
"fname": "Get shuffled order",
"n": "{@NumImages}"
}
const ShortcutResult1 = runSelf(Dictionary14)
@ImgList1 = @ImgList
@ImgList
for _ in ShortcutResult1 {
getListItem(@ImgList1, @RepeatItem)
@ImgList
}
@ImgList1
} else {
if @Ordering == "Oldest first" {
rawAction("is.workflow.actions.filter.images", {
"WFContentItemInputParameter": "@ImgList",
"WFContentItemSortOrder": "Oldest First",
"WFContentItemSortProperty": "Date Taken"
})
} else {
rawAction("is.workflow.actions.filter.images", {
"WFContentItemInputParameter": "@ImgList",
"WFContentItemSortOrder": "Latest First",
"WFContentItemSortProperty": "Date Taken"
})
}
@ImgList
}
}
}
// For nested collages, perform batching and recursive call. Only do this if not beyond the max recursion limit and there are enough images in the current call to allow for it. Doing it here so that resulting sub-collages are treated for resizing as normal.
if @CollageType contains "Nested" {
// Conditionally create batches and prepare options dictionary for recursive call. Corner rounding will be set to zero, image spaceing is doubled (since nested collages will be smaller), aspect ratio will be randomly chosen between the specified min and max values (see top of shortcut), collage width and height are reduced
// Also don’t recurse if the collage aspect ratio is too wide or too tall such that a vertical or horizontal strip should be used instead
@DoRecurse = True
const Width = getImageDetail(@ImgList, "Width")
const Maximum2 = statistic("Maximum", nil)
const Sum = statistic("Sum", nil)
const Height = getImageDetail(@ImgList, "Height")
const Maximum1 = statistic("Maximum", nil)
const Sum1 = statistic("Sum", nil)
const CalculationResult4 = Sum / Maximum1
if @TargetAR >= CalculationResult4 {
@DoRecurse = False
}
const CalculationResult5 = Maximum2 / Sum1
if @TargetAR <= CalculationResult5 {
@DoRecurse = False
}
const CalculationResult6 = @NumImages / @MinBatchSize
if @DebugPrinting == {
appendToFile(LogfileName)
}
if CalculationResult6 <= 3 {
@DoRecurse = False
}
if @RecursionDepth >= MaxRecursionDepthDefault {
@DoRecurse = False
}
if @DoRecurse == 3 {
if @DebugPrinting == {
appendToFile(LogfileName)
}
const Dictionary15 = {
"fname": "Create batches",
"n": "{@NumImages}",
"sizemax": "{@MaxBatchSize}",
"sizemin": "{@MinBatchSize}"
}
const ImgBatchDict = runSelf(Dictionary15)
const NumBatches = count(ImgBatchDict['Keys'])
if @DebugPrinting == {
appendToFile(LogfileName)
}
const SubImageSpacing = round(*1.0)
const CurrentRecursionDepth = getValue(@Options, "Recursion depth")
if CurrentRecursionDepth {
} else {
}
const SubMaxWidthheight = round(@CollageSize*0.5)
const Dictionary16 = setValue(@Options, "Max recursion depth", @MaxRecursionDepth)
const Dictionary17 = setValue(Dictionary16, "Round image corners", "0")
const Dictionary18 = setValue(Dictionary17, "Round collage corners", "0")
const Dictionary19 = setValue(Dictionary18, "Image spacing", SubImageSpacing)
const Dictionary20 = setValue(Dictionary19, "Recursion depth", NewRecursionDepth)
const Dictionary21 = setValue(Dictionary20, "Collage max width/height", SubMaxWidthheight)
@ImgList1
repeat _ for NumBatches {
const RandomNumber1 = randomNumber(MinARX100, MaxARX100)
const SubcollageAR = RandomNumber1 / 100
setValue(Dictionary21, "Target aspect ratio", SubcollageAR)
const CurBatch = getValue(ImgBatchDict, @RepeatIndex)
const CurBatchSize = count(CurBatch)
if @DebugPrinting == {
appendToFile(LogfileName)
}
// List of color patches in base64 in the following order: 1 cyan, 2 orange, 3 red, 4 green, 5 purple, 6 magenta, 7 yellow
const b64Colors = list("iVBORw0KGgoAAAANSUhEUgAAAdoAAAHZCAYAAAAhcPoBAAABgGlDQ1BzUkdCIElFQzYxOTY2LTIuMQAAKJF1kctLQkEUhz+tKMooyEVBCwlrpdEDpDZBRlQgIWaQ1Uavr8DH5V4lpG3QNiiI2vRa1F9Q26B1EBRFEK1dF7UpuZ2rghJ5hjPzzW/OOcycAWswpaT15hFIZ3JaYM7rWAmtOlqLWLDTI94XVnR12u/30dC+niRa7MFt1moc9691RGO6ApY24SlF1XLC88K+zZxq8r6wXUmGo8KXwi5NLij8aOqRChdNTlT4x2QtGJgBa7ewI1HHkTpWklpaWF6OM53KK9X7mC+xxTLLS7IOiPejE2AOLw4WmGUGD6NMyuzBzRjDsqNB/kg5f5Gs5CoyqxTQ2CBBkhwuU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ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJ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AACXBIWXMAAC4jAAAuIwF4pT92AAAHiklEQVR4nO3YwU3DUBBF0TFOGZFCb9Tl3li4jchsKOFfoqBzCnia3ZVmu465BgBIfLz6AAD4z4QWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILAKFbsPmcmTPYBYDafWb2lYNFaM/taz6DXQBIXcd8z8xj5abXMQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0AB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EJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASD0uXrAP24zs60eAcBLuc7MZfWIZ0cN7fb1O9+rRwDwOvbz/MwBQ+s6BoCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQOu3nua8e8YfbzGyrRw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wAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhG6rB5zob2Yeq0cAMDMz+8zcV484wzeF9jE//7+rRwAwM8c28yWhdR0DQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBIHRbPeBE+xzb6g0AvO2rB5zlMsf2XD0CAD6V6xgAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJ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JLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBC++oBN/P+HsA/O77HBYT2Wu/n2F6rRwD84hxzDKG9jNcxAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFg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CQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAELfqwfwsufM7KtHAJn7zNxWj+A6oX1/+zY/v6tHAI1zjr+ZeazewXWuYwAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQGg75zhXj+Alz5nZV48AMveZua0ewXVCCwAh1zEAhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEBJaAAgJLQCEhBYAQkILACGhBYCQ0AJASGgBICS0ABASWgAICS0AhIQWAEJCCwAhoQWAkNACQEhoASAktAAQEloACAktAISEFgBCQgsAIaEFgJDQAkBIaAEgJLQAEPoHsFUUQ9USgIUAAAAASUVORK5CYII=")
if CurBatchSize == 1 {
const ItemFromList2 = getListItem(CurBatch, 0)
getListItem(@ImgList, ItemFromList2)
@TmpImg
} else {
@BatchImgList
for _ in CurBatch {
const ItemFromList3 = getListItem(@ImgList, @RepeatItem2)
resizeImageByPercent(ItemFromList3, "65")
@TmpImg
// Overlay colored border on images of next betch
if @DoColorByDepth == {
if @DebugPrinting == {
appendToFile(LogfileName)
}
const DepthColorInd1 = @RecursionDepth + 2
const b64DepthColor1 = getListItem(b64Colors, DepthColorInd1)
const DepthColor1 = base64Encode(b64DepthColor1)
customImageOverlay(@TmpImg, DepthColor1, @TmpImg, @TmpImg, "0", "100")
@TmpImg
}
@BatchImgList = @TmpImg
nothing()
}
const Dictionary22 = {
"fname": "Photo collage"
}
const Dictionary23 = setValue(Dictionary22, "options")
if @DebugPrinting == {
appendToFile(LogfileName)
}
base64Encode(@BatchImgList)
@BatchImgList
const Dictionary24 = setValue(Dictionary23, "images")
runSelf(Dictionary24)
@TmpImg
if @DebugPrinting == {
appendToFile(LogfileName)
}
}
// Color image based on recursion depth
if @DoColorByDepth == {
if @DebugPrinting == {
appendToFile(LogfileName)
}
const DepthColorInd = @RecursionDepth + 1
const b64DepthColor = getListItem(b64Colors, DepthColorInd)
const DepthColor = base64Encode(b64DepthColor)
customImageOverlay(@TmpImg, DepthColor, @TmpImg, @TmpImg, "0", "100")
@TmpImg
}
@ImgList1 = @TmpImg
nothing()
}
@ImgList = @ImgList1
@ImgList1
count(@ImgList)
@NumImages
}
}
if @DoRotate == "Columns" {
if @DebugPrinting == {
appendToFile(LogfileName)
}
@ImgList1
for _ in @ImgList {
rotateMedia(@RepeatItem, "")
@ImgList1
nothing()
}
@ImgList = @ImgList1
@ImgList1
@TargetAR = 1 / @TargetAR
}
// Compute number of rows in collage
const Height1 = getImageDetail(@ImgList, "Height")
const MaxHeight = statistic("Maximum", nil)
const Width1 = getImageDetail(@ImgList, "Width")
const Maximum3 = statistic("Maximum", nil)
const Average = statistic("", nil)
const Average1 = statistic("", nil)
const AverageAR = Average / Average1
const TotalWidth = statistic("Sum", nil)
const TargetWidth = max((Average1+Average)/2* sqrt(@NumImages * @TargetAR),50)
// Resize images to common width or height depending on number of rows, and apply per-image corner rounding if used
const NumRows = min(@NumImages,max(1, round(TotalWidth/TargetWidth)))
const NumCols = @NumImages / NumRows
if DeviceModel1 == "Mac" {
number(MaxHeight)
} else {
const MaxWidthHeight = 1200
}
if DeviceModel1 == "Mac" {
} else {
const MaxWidthHeight1 = 1200
}
if NumRows == @NumImages {
@CommonWidth
} else {
if NumRows == 1 {
} else {
}
@CommonHeight
}
if @DebugPrinting == {
appendToFile(LogfileName)
}
@ImgList1
for _ in @ImgList {
if @DebugPrinting == 1 {
appendToFile(LogfileName)
}
if NumRows < @NumImages {
// Multiple images per row, so resize to common height
resizeImage(@RepeatItem, "", @CommonHeight)
} else {
// Single column collage, so resize to common width
resizeImage(@RepeatItem, @CommonWidth)
}
@ImgList1
nothing()
}
@ImgList = @ImgList1
@ImgList1
@TmpImg
if NumRows == 1 {
if @DebugPrinting == {
appendToFile(LogfileName)
}
rawAction("is.workflow.actions.image.combine", {
"WFImageCombineSpacing": "@CollageSpacing",
"WFInput": "@ImgList"
})
@OutImg
nothing()
} else {
if NumRows == @NumImages {
if @DebugPrinting == {
appendToFile(LogfileName)
}
rawAction("is.workflow.actions.image.combine", {
"WFImageCombineMode": "Vertically",
"WFImageCombineSpacing": "@CollageSpacing",
"WFInput": "@ImgList"
})
@OutImg
nothing()
} else {
repeat _ for @NumImages {
const W = getListItem(Width1, @RepeatIndex)
const H = getListItem(Height1, @RepeatIndex)
@AspectRatios += round(W/H*100)
}
if @DebugPrinting == {
appendToFile(LogfileName)
}
const Dictionary25 = {
"fname": "Linear partition",
"nrows": "{NumRows}"
}
const Dictionary26 = setValue(Dictionary25, "seq", @AspectRatios)
const ShortcutResult2 = runSelf(Dictionary26)
const Solution = getLastItem(ShortcutResult2)
const k1 = NumRows - 1
@k = k1
@n = @NumImages
nothing()
repeat _ for k1 {
@Row
const Solutionn1 = getValue(Solution)
const Solutionn1k = getValue(Solutionn1, @k)
const CalculationResult7 = @n - Solutionn1k
repeat _ for CalculationResult7 {
const CalculationResult8 = @RepeatIndex2 + Solutionn1k
getListItem(@ImgList, CalculationResult8)
@Row
nothing()
}
if @DoRotate == {
if @DebugPrinting == {
appendToFile(LogfileName)
}
@ImgList1
count(@Row)
for _ in @Row {
const CalculationResult9 = -@RepeatIndex2+1
getListItem(@Row, CalculationResult9)
@ImgList1
}
@Row = @ImgList1
@ImgList1
}
if @DebugPrinting == {
appendToFile(LogfileName)
}
rawAction("is.workflow.actions.image.combine", {
"WFImageCombineSpacing": "@CollageSpacing",
"WFInput": "@Row"
})
@ImgRows
@k = @k - 1
@n = Solutionn1k
nothing()
}
@Row
repeat _ for @n {
getListItem(@ImgList, @RepeatIndex)
@Row
nothing()
}
if @DoRotate == {
if @DebugPrinting == {
appendToFile(LogfileName)
}
@ImgList1
count(@Row)
for _ in @Row {
const CalculationResult10 = -@RepeatIndex+1
getListItem(@Row, CalculationResult10)
@ImgList1
}
@Row = @ImgList1
@ImgList1
}
if @DebugPrinting == {
appendToFile(LogfileName)
}
rawAction("is.workflow.actions.image.combine", {
"WFImageCombineSpacing": "@CollageSpacing",
"WFInput": "@Row"
})
@ImgRows
@Row
const Width2 = getImageDetail(@ImgRows, "Width")
const Minimum = statistic("Minimum", nil)
@ImgList
for _ in @ImgRows {
if @DebugPrinting == 1 {
appendToFile(LogfileName)
}
resizeImage(@RepeatItem, Minimum)
@ImgList
nothing()
}
// Reverse order of rows to bring them back into order
if @DebugPrinting == {
appendToFile(LogfileName)
}
@ImgRows
for _ in @ImgList {
const CalculationResult11 = NumRows-@RepeatIndex+1
getListItem(@ImgList, CalculationResult11)
@ImgRows
nothing()
}
if @DebugPrinting == {
appendToFile(LogfileName)
}
@ImgList
rawAction("is.workflow.actions.image.combine", {
"WFImageCombineMode": "Vertically",
"WFImageCombineSpacing": "@CollageSpacing",
"WFInput": "@ImgRows"
})
@OutImg
nothing()
}
nothing()
}
if @CollageCornerRoundingPercent > 0 {
const List7 = list(@OutImg['Width'], @OutImg['Height'])
statistic("Minimum", nil)
const AdjCornerRadius1 = round(/2*@CollageCornerRoundingPercent/100)
if @DebugPrinting == {
appendToFile(LogfileName)
}
maskImage(@OutImg, "", AdjCornerRadius1)
@OutImg
nothing()
}
if @DoRotate == "Columns" {
if @DebugPrinting == {
appendToFile(LogfileName)
}
rotateMedia(@OutImg, "270")
@OutImg
nothing()
}
rawAction("is.workflow.actions.gettimebetweendates", {
"WFInput": "{CurrentDate}",
"WFTimeUntilFromDate": "{}",
"WFTimeUntilUnit": "Total Time"
})
// For recursive calls and calls using an input dictionary, return output image here
if @DebugPrinting == {
appendToFile(LogfileName)
}
if @OutputImageDirectly == {
output(@OutImg)
}
// “Show result” has a pretty low pixel height limit for displaying images on iOS, but can fall back on quick look
if DeviceModel1 == "Mac" {
show(@OutImg)
} else {
const MaxShowResultImageHeight = 7000
if @OutImg > MaxShowResultImageHeight {
openApp("com.apple.shortcuts")
quicklook(@OutImg)
} else {
show(@OutImg)
}
}
menu {
item "✅ Save and quit":
savePhoto(@OutImg)
item "🔁 Save and restart with new options":
savePhoto(@OutImg)
runSelf(@InputImgList)
item "🗑️ Discard and restart with new options":
runSelf(@InputImgList)
item "🔥 Quit without saving":
}
// Check for updates, only once per run (recursive calls have exited already)
nothing()
/*
【Auto-Update Routine】
Checks For Latest Shortcut Version
↳ https://routinehub.co/shortcut/16590/
*/
const Info = {
"Author": "twilsonco",
"RoutineHub ID": 17870,
"Version": "1.2.0",
"Version Check": true
}
const True2 = getValue(Info, "Version Check")
if True2 == "Yes" {
const CurrentIPAddress = getExternalIP("IPv4")
if CurrentIPAddress {
const Result = downloadURL("https://routinehub.co/api/v1/shortcuts/{Info['RoutineHub ID']}/versions/latest")
if Result contains "success" {
const SplitText2 = splitText(Result['Version'], ".")
for _ in SplitText2 {
@LatestVersion = ((1/1000)^@RepeatIndex)*@RepeatItem+@LatestVersion
}
const SplitText3 = splitText(Info['Version'], ".")
for _ in SplitText3 {
@CurrentVersion = ((1/1000)^@RepeatIndex)*@RepeatItem+@CurrentVersion
}
if @LatestVersion > @CurrentVersion {
menu "New Version: {Result['Version']}\nRelease: {Result['Release']}\nWhats New: \"{Result['Notes']}\"" {
item "Update → {Result['Version']}":
expandURL(Result['URL'])
const UpdatedText = replaceText("https://www.icloud.com/", "shortcuts://", false)
openURL(UpdatedText)
stop()
item "Skip ({Info['Version']})":
}
}
}
}
}
/*
【Auto-Update Routine Ends Here】
Support → https://www.reddit.com/r/shortcuts/comments/18j4f9p/
【⚙️】
Convert Semantic Number to Decimals
↳ https://routinehub.co/shortcut/16589/
*/
Dekompileret med cherri 2.3.0 (GPL-2.0). Kan kræve små rettelser, før den kan kompileres.
Bedømmelser og anmeldelser
Skriv en anmeldelse–
ud af 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Ingen anmeldelser endnu. Vær den første!
Annonce
Mere fra twilsonco
Du vil måske også kunne lide
Annonce