Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
cordova-plugin-instagram-assets-picker
Advanced tools
This is a cordova plugin for iOS that provides an image picker like Instagram, allowing you to crop photo and video with GPUImage.
The app in the GIF shows how to use the cordova-plugin-video-editor and is using this plugin. Here is a YouTube video showing more of it. Here is the source code for the app shown in the gif and video.
cordova plugin add cordova-plugin-instagram-assets-picker
InstagramAssetsPicker
will be available globally after deviceready.
To install the latest code from this repo (may be unstable) -
cordova plugin add https://github.com/rossmartin/cordova-plugin-instagram-assets-picker.git
If you see Could not locate build.xcconfig, you will need to set HEADER_SEARCH_PATHS manually.
in the CLI output when adding the plugin you will need to add an entry to your Xcode project Header Search Paths. I have this step automated but for some reason it isn't working for everyone. To do this navigate to your project Build Settings and add "$(SRCROOT)/$(PRODUCT_NAME)/cordova-plugin-instagram-assets-picker/GPUImageHeaders"
to your Header Search Paths. See the screenshot below for reference -
InstagramAssetsPicker.getMedia(
function(result) { // success cb
console.log('getMedia success, result: ', JSON.stringify(result, null, 2));
// result will be an object with at least a phAssetId, filePath, and type property
// you will only get the rect object when 'cropAfterSelect' is false
// the rect object is required for the cropAsset function documented below
/* example of result when the 'cropAfterSelect' option is set to false
{
phAssetId: "A1785F1A-EF0F-458C-9AF9-C439981CE0FB/L0/001",
type: "video",
rect: {
Width: 0.5625000293366611,
Height: 0.9999999823048711,
Y: 0,
X: 0.2496093880181434
},
filePath: "file:///Users/rossmartin/Library/Developer/CoreSimulator/Devices/6465544C-C262-4EA8-BA7C-8BAB4AB98597/data/Media/DCIM/100APPLE/IMG_0006.m4v"
}
*/
},
function(err) { // error cb
console.log('getMedia error, err: ', err);
},
{ // options
type: 'video', // accepts 'photo', 'video', or 'all' - defaults to all
cropAfterSelect: false, // see the note above for when this is false - defaults to false
showGrid: false // determines whether to show the grid for cropping - defaults to false
}
);
The reason this option exists is to provide a better user experience. It takes time to crop an asset with GPUImage so in most cases for a better UX you'll want to call cropAsset
later with the result from the getMedia
function. This also allows showing your own UI loading indicator while the cropping is being performed.
The iOS simulator will not finish a crop using getMedia
(with cropAfterSelect
set to true
) or cropAsset
. It works fine on a device. I will be looking into why it doesn't work on the simulator.
InstagramAssetsPicker.cropAsset(
function(result) { // success cb
// result is an object with a filePath and type property
console.log('cropAsset success, result: ', result);
/* example of result
{
type: "video",
filePath: "file:///Users/rossmartin/Library/Developer/CoreSimulator/Devices/6465544C-C262-4EA8-BA7C-8BAB4AB98597/data/Media/DCIM/100APPLE/IMG_0006.m4v"
}
*/
},
function(err) { // error cb
console.log('cropAsset error, err: ', err);
},
{ // options, both properties below are required
phAssetId: "A1785F1A-EF0F-458C-9AF9-C439981CE0FB/L0/001",
rect: {
Width: 1,
Height: 0.5625,
Y: 0.249609375,
X: 0
}
}
);
InstagramAssetsPicker (Modified by me to add features for this plugin and subtle improvements.)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Cordova Instagram Assets Picker Plugin
The npm package cordova-plugin-instagram-assets-picker receives a total of 0 weekly downloads. As such, cordova-plugin-instagram-assets-picker popularity was classified as not popular.
We found that cordova-plugin-instagram-assets-picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.