UNPKG

ngx-pica

Version:

Angular 5 module to resize images files in browser

157 lines 3.38 kB
import { Injectable } from '@angular/core'; var NgxPicaImageService = (function () { function NgxPicaImageService() { this.imageExtensions = [ "ase", "art", "bmp", "blp", "cd5", "cit", "cpt", "cr2", "cut", "dds", "dib", "djvu", "egt", "exif", "gif", "gpl", "grf", "icns", "ico", "iff", "jng", "jpeg", "jpg", "jfif", "jp2", "jps", "lbm", "max", "miff", "mng", "msp", "nitf", "ota", "pbm", "pc1", "pc2", "pc3", "pcf", "pcx", "pdn", "pgm", "PI1", "PI2", "PI3", "pict", "pct", "pnm", "pns", "ppm", "psb", "psd", "pdd", "psp", "px", "pxm", "pxr", "qfx", "raw", "rle", "sct", "sgi", "rgb", "int", "bw", "tga", "tiff", "tif", "vtf", "xbm", "xcf", "xpm", "3dv", "amf", "ai", "awg", "cgm", "cdr", "cmx", "dxf", "e2d", "egt", "eps", "fs", "gbr", "odg", "svg", "stl", "vrml", "x3d", "sxd", "v2d", "vnd", "wmf", "emf", "art", "xar", "png", "webp", "jxr", "hdp", "wdp", "cur", "ecw", "iff", "lbm", "liff", "nrrd", "pam", "pcx", "pgf", "sgi", "rgb", "rgba", "bw", "int", "inta", "sid", "ras", "sun", "tga" ]; } /** * Check if given file is an image or not * * @param {File} file * @returns {boolean} */ /** * Check if given file is an image or not * * @param {File} file * @returns {boolean} */ NgxPicaImageService.prototype.isImage = /** * Check if given file is an image or not * * @param {File} file * @returns {boolean} */ function (file) { var fileExtension = file.name.toLowerCase().substr(file.name.lastIndexOf('.') + 1); return (this.imageExtensions.indexOf(fileExtension) !== -1); }; NgxPicaImageService.decorators = [ { type: Injectable }, ]; /** @nocollapse */ NgxPicaImageService.ctorParameters = function () { return []; }; return NgxPicaImageService; }()); export { NgxPicaImageService }; //# sourceMappingURL=ngx-pica-image.service.js.map