Skip to content

Instantly share code, notes, and snippets.

@reviloera
reviloera / imageOrientation.ts
Created April 17, 2020 06:13 — forked from scf37/imageOrientation.ts
Rotate image preview to compensate for EXIF orientation (Javascript / Typescript)
// Based on: https://stackoverflow.com/a/46814952/283851
// Based on: https://gist.github.com/mindplay-dk/72f47c1a570e870a375bd3dbcb9328fb
/**
* Create a Base64 Image URL, with rotation applied to compensate for EXIF orientation, if needed.
*
* Optionally resize to a smaller maximum width - to improve performance for larger image thumbnails.
*/
export function getImageUrl(file: File, maxWidth: number|undefined): Promise<string> {
return readOrientation(file).then(orientation => applyRotation(file, orientation || 1, maxWidth || 999999));
}
@reviloera
reviloera / create_ipa.sh
Created May 10, 2017 21:46 — forked from six519/create_ipa.sh
Building Ionic iOS Release And Generate ipa File Script
#!/bin/bash
# Thanks to: https://gist.github.com/DavidFrahm/4409d6b74e46377e7be7
# Usage: ./create_ipa.sh <Scheme Name> <Provisioning Profile>
echo "Building Ionic iOS release..."
ionic build --release ios
pushd platforms/ios/
echo "Building archive file..."
xcodebuild -scheme "$1" -configuration Release clean archive -archivePath "build/$1.xcarchive"
1. Create a folder called Payload
2. Place the .app folder inside of that
3. Zip up the Payload folder using normal compression
4. Then rename the file with a .ipa extension