Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error : Not a valid marker at offset 684, found: 140 <-- what?? #1113

Closed
pouu69 opened this issue Nov 3, 2015 · 15 comments
Closed

error : Not a valid marker at offset 684, found: 140 <-- what?? #1113

pouu69 opened this issue Nov 3, 2015 · 15 comments

Comments

@pouu69
Copy link

pouu69 commented Nov 3, 2015

upload image situation i see this error => Not a valid marker at offset 684, found: 140

what is it??

@danialfarid
Copy link
Owner

That's just a warning for an error in exif info of the file. That's shouldn't cause any problem. Only if the file has orientation exif info it means that it cannot rotate the file to fix the orientation

@danialfarid
Copy link
Owner

Leave this open I will try to make it a warning or suppress this

@voltechs
Copy link

voltechs commented Nov 9, 2015

This error is preventing multiple file uploads, when I drag a group of photos onto the drop zone, just FYI

danialfarid pushed a commit that referenced this issue Nov 10, 2015
@danialfarid
Copy link
Owner

Fixed at version 10.0.0

By default ngf-fix-orientation is off so you need to enable it. Also that error should not prevent upload anymore.

@Johnnyrook777
Copy link

Hi Danialfarid. When uploading files without EXIF data and setting fix rotate to true you get this error (v10.0.2). Would it be better to return null when checking the EXIF data rather than throwing an error?

@danialfarid
Copy link
Owner

What error do you see? @Johnnyrook777

@Johnnyrook777
Copy link

Two examples:
Not a valid marker at offset 623, found: 243
Not a valid marker at offset 623, found: 236

Seem you get this error if the EXIF data isn't present, in which case you should simply not rotate the image.

The orientation method currently rejects the promise if a string is found via the EXIF, I'm thinking it might be better to resolve a null. It may actually be better to check if the result is a number. Something like the code below

Sorry, I'm not super familiar with the library, so I'm not sure what the implications may be for this change

upload.orientation = function (file) {
        if (file.$ngfOrientation != null) {
            return upload.emptyPromise(file.$ngfOrientation);
        }
        var defer = $q.defer();
        var fileReader = new FileReader();
        fileReader.onload = function (e) {
            var orientation;
            try {
                orientation = findEXIFinJPEG(e.target.result);
            } catch (e) {
                defer.reject(e);
                return;
            }

            // Proposed solution 1 - Check for a number result
            if (angular.isNumber(orientation)) {
                file.$ngfOrientation = orientation;
                defer.resolve(orientation);
            }
            else {
                 defer.resolve();
            }

            // Proposed solution 2
            if (angular.isString(orientation)) {
                // Johnnyrook Fix, 
                defer.resolve();
                // Original
                //defer.reject(orientation);
            } else {
                file.$ngfOrientation = orientation;
                defer.resolve(orientation);
            }
        };
        fileReader.onerror = function (e) {
            defer.reject(e);
        };

        fileReader.readAsArrayBuffer(file);
        return defer.promise;
    };

@danialfarid
Copy link
Owner

Can you attach the images that produce that error here?

@Johnnyrook777
Copy link

l2e5cvl

@Johnnyrook777
Copy link

Pretty sure it will occur with any image that doens't have the EXIF properites.

Also, for reference. This is my button HTML

<button class="btn btn-primary btn-file" ngf-select="uploadFiles($file)" ngf-resize="{width: 1024, height: 1024, quality: 0.95}" ngf-fix-orientation="true" accept="image/*" title="Add or change Photo"> Photo </button>

@danialfarid
Copy link
Owner

Alright will be fixed in the next version. For now you can just ignore the error since it doesn't affect the functionality.

@danialfarid danialfarid reopened this Nov 17, 2015
@Johnnyrook777
Copy link

Thanks @danialfarid.

Yeah, I've got a quick workaround in our production version.

Thanks mate. Much appreciated

@carlosfunk
Copy link

It's been a while since I laughed reading some github comments, thanks for that picture @Johnnyrook777

@Johnnyrook777
Copy link

Hahaha, thanks @carlosfunk

I actually found the issue when I uploaded that pic to our testing system .... Its now my goto picture for all testing and/or profile pictures ;)

danialfarid pushed a commit that referenced this issue Nov 27, 2015
@danialfarid
Copy link
Owner

Fixed at version 10.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants