npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ionimage

v0.1.6

Published

Tools to select and upload images using ionic framework

Downloads

16

Readme

ionimage

Library to easily get images from user and upload them using ionic.

Requirements

This library depends on

Usage

ionimgMediaLister service

This provides a direct binding to the media lister plugin used to list images. The only change in the API is that readLibrary returns a $q promise.

ionimgPicker directive

This directive shows a selectable list of the images in the user gallery. If you want the basic style provided you include ionimage.css.

<ionimg-picker selected-images="myImages" img-width="200" img-height="200" />

The selected-images will contain the images selected by the user. img-width and img-height are used to generate the thumbnails, but you need to modify the style yourself.

NOTE: on Android, images are not loaded in memory, and therefore, generated thumbnails will not be exactly the given size. See Loading large bitmaps efficiently for more info.

ionimgUploader service

This is a wrapper around fileTransfer It takes a list of image as returned by ionimgMediaLister and upload them to the given URL.

var uploadUrl = 'http://example.com/upload'
ionimgUploader.upload(uploadUrl, this.voice.images, {parseResponse: true})
      .then(function (res) {
        console.log(res);
        // [{
        //   state: 'fulfilled',
        //   value: {
        //     bytesSent: 163944,
        //     objectId: "",
        //     filePath: "/storage/sdcard1/saved_SDdata/SD_pictures/1377855875036.jpg",
        //     responseCode: 200,
        //     response: "whatever the server returned"
        //   }
        // }, {
        //   state: 'rejected',
        //   reason: {
        //     code: 1,
        //     exception: "whatever error occured",
        //     source: "/storage/sdcard1/saved_SDdata/SD_pictures/1377855875036:fail.jpg"
        //   }
        // }]
      }, null, function (progress) {
        console.log(progress);
        // {
        //   loaded: 2230966, // total bytes uploaded
        //   total: 2231005,  // total bytes to upload (for file which already started)
        //   currentCount: 3, // number of files that have already started to upload
        //   totalCount: 4    // total number of files to upload
        // }
      });

By default, the image that have already been updated are cached (using their path as key), so they do not get uploaded multiple times. You can pass force: true to disable this behavior.

Status

The library is not stable yet, I suggest you wait a little before using this seriously.

The iOS version of the required cordova plugin is still in development.