Scan with your iPhone to install
Shrink a photo to fit your iDevice
What's New
Version 1.0
First release
What it does
44 actions-
If
-
Set VariablePhoto
-
If
-
Select Photos
-
Set VariablePhoto
-
Get Dictionary Value
-
If
-
Text
-
URLdata:text/html,…
-
Split Text
-
Get Item from List
-
Set VariableScreen Height
-
Get Item from List
-
Set VariableScreen Width
-
If
-
If
-
List
-
Choose from List
-
If
-
Text
-
If
-
Text
-
If
-
Text
-
If
-
Text
-
If
-
If
-
Resize Image
-
Set VariablePhoto
-
If
-
Resize Image
-
Set VariablePhoto
-
Crop Image
-
Set Name
-
Quick Look
-
Convert Image
-
Set VariablePhoto
-
Get Dictionary Value
-
Set VariableCroppers
-
If
-
Choose from List
-
Get Dictionary Value
-
Set VariableCroppers
View as code
Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.
#include 'actions/photos'
#define color lightblue
#define glyph picture
if ShortcutInput {
@Photo = ShortcutInput
} else {
selectPhotos()
@Photo
}
const DictionaryValue = getValue({}, @Photo['Height'])
if !DictionaryValue {
const URL = url("data:text/html,{}")
const SplitText = splitText(URL)
getListItem(SplitText, 0)
@ScreenHeight
getListItems(SplitText, 0, 0)
@ScreenWidth
if @ScreenWidth <= @Photo {
if @ScreenHeight <= @Photo {
const List = list("ShrinkToFit")
const ChosenItem = chooseFromList(List, "The selected image is larger than the screen. It will be adjusted to fit properly. Choose an option below: ")
if ChosenItem == "Crop to fit" {
} else {
}
} else {
}
} else {
}
if IfResult == "Resize" {
if @Photo > @Photo {
resizeImage(@Photo, "", @ScreenHeight)
@Photo
} else {
resizeImage(@Photo, @ScreenWidth)
@Photo
}
}
const CroppedImage = cropImage(@Photo, @ScreenWidth, @ScreenHeight)
const RenamedItem = setName(CroppedImage, "Press on the Share button and tap Save image.")
quicklook(RenamedItem)
convertImage(CroppedImage, "PNG")
@Photo
}
@Croppers = nil[@Photo['Height']]
if @Croppers !contains "Models" {
chooseFromList(@Croppers, "What type of device are you making icons for?")
@Croppers = @Croppers[]
}
Open in Cherri Playground
Decompiled with cherri 2.3.0 (GPL-2.0). May need small fixes before it compiles.
Ratings & Reviews
Write a Review–
out of 5
★★★★★
★★★★
★★★
★★
★
0 ratings
No reviews yet. Be the first to share what you think!
Advertisement
More by outlander-2007
You Might Also Like
Advertisement