How to use the blueimp-load-image.parseMetaData function in blueimp-load-image

To help you get started, we’ve selected a few blueimp-load-image examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Uintra / Uintra / src / Compent.uIntra / App_Plugins / Core / Controls / FileUpload / file-upload.js View on Github external
dropzone.on('addedfile', function(file) {
                var self = this;
                //in bulletins this container is hidden so you can see error message
                if (self.previewsContainer.classList.contains('hidden')) {
                    self.previewsContainer.classList.remove('hidden');
                }
                loadImage.parseMetaData(file, function (data) {
                    // use embedded thumbnail if exists.
                    if (data.exif) {
                        var thumbnail = data.exif.get('Thumbnail');
                        var orientation = data.exif.get('Orientation');
                        if (thumbnail && orientation) {
                            loadImage(thumbnail, function (img) {
                                self.emit('thumbnail', file, img.toDataURL());
                            }, { orientation: orientation });
                            return;
                        }
                    }
                    // use default implementation for PNG, etc.
                    self.createThumbnail(file);
                });
            });
github topcoder-platform / community-app / src / shared / components / Settings / Profile / BasicInfo / ImageInput / index.jsx View on Github external
const file = fileInput.files[0];
    if (file === undefined) {
      return;
    }
    if (file.size > 2 * 1024 * 1024) {
      // If file size is greater than 2 MB, show error message
      this.setState({
        isImageOversize: true,
      });
      return;
    }
    this.setState({
      isImageOversize: false,
    });
    uploadPhotoInit();
    loadImage.parseMetaData(file, (data) => {
      let orientation = 0;
      if (data.exif) {
        orientation = data.exif.get('Orientation');
      }
      loadImage(
        file,
        (img) => {
          img.toBlob(
            (blobResult) => {
              uploadPhoto(handle, tokenV3, blobResult);
            },
          );
        }, {
          canvas: true,
          orientation,
        },
github nerdic-coder / block-photos / src / services / upload-service.ts View on Github external
const info = await Device.getInfo();
          let thumbnailData = null;
          let viewerData = null;
          thumbnailData = await PhotosService.compressPhoto(
            tempFile,
            PhotoType.Thumbnail,
            tempFile.type
          );
          if (info.model !== 'iPhone' && info.model !== 'iPad') {
            viewerData = await PhotosService.compressPhoto(
              tempFile,
              PhotoType.Viewer,
              tempFile.type
            );
          }
          loadImage.parseMetaData(
            tempFile,
            data => {
              const reader = new FileReader();

              let orientation = 1;
              if (data && data.exif) {
                orientation = data.exif.get('Orientation');
              }

              // Closure to capture the file information.
              reader.onload = ((loadedFile, loadedList, loadedOrientation) => {
                return async event => {
                  const originalData = event.target.result;
                  if (loadedOrientation) {
                    loadedFile.exifdata = {
                      tags: {

blueimp-load-image

JavaScript Load Image is a library to load images provided as File or Blob objects or via URL. It returns an optionally scaled, cropped or rotated HTML img or canvas element. It also provides methods to parse image metadata to extract IPTC and Exif tags a

MIT
Latest version published 3 years ago

Package Health Score

58 / 100
Full package analysis