COMPILE + RUNTIME / PASSED · FOUNDATION / v0.2.7
Experimental safety check. The supplied source contains a deletePhotos action after its confirmation alert. Test with backed-up or disposable photos.
import Shortcuts
#Color: navy, #Icon: photoStackAlt
// Re-ProRAW — Converted HEIF Size Probe v0.2.8
// Status: EXPERIMENTAL — compile and runtime verification required (Passed)
// Protected foundation: Re-ProRAW v0.2.7
// New behavior: retrieve raw file size from one converted HEIF.
// Safety: Creates converted copies only. Never deletes originals.
showResult(text: "Re-ProRAW Converted-Size Test | Select batch of ProRAW photo(s). All originals will be kept.")
selectPhoto(types: Images, multiple: true) >> selectedPhotos
count(type: Items, input: selectedPhotos) >> photoCount
if(photoCount == "0") {
showResult(text: "No photos were selected. Nothing was changed.")
exit(var: selectedPhotos)
} >> IFResult1
fileDetail(input: selectedPhotos, property: File Size) >> originalSizes
statistic(input: originalSizes, operation: Sum) >> originalBytes
calculate(input: "${originalBytes} / 1000000") >> originalMegabytes
formatNumber(number: originalMegabytes, places: 2) >> roundedMegabytes
showResult(text: "Selected: ${photoCount} photo(s) Original total size: ${ActionOutput} MB ")
repeatEach(selectedPhotos) {
convertImage(image: RepeatItem, format: HEIF, metadata: true, quality: true) >> convertedHEIF
saveToCameraRoll(image: convertedHEIF, album: Ask) >> savedHEIF
// Only new behavior in this experimental revision.
fileDetail(input: convertedHEIF, property: File Size) >> convertedBytesProbe
} >> RepeatResult1
alert(alert: "Converted-size checkpoint passed. Converted HEIF size: ${convertedBytesProbe} bytes. Delete originals?", title: "Delete originals?")
deletePhotos(photos: selectedPhotos) >> deletePhotos1
showResult(text: "Conversion complete. Processed ${photoCount} photo(s).")
exit(var: selectedPhotos)