client/js/image-support/exif.js
function getTagValues(littleEndian, dirEntries) {
        var TAG_VAL_OFFSET = 16,
            tagsToFind = qq.extend([], TAG_IDS),
            vals = {};

        qq.each(dirEntries, function(idx, entry) {
            var idHex = entry.slice(0, 4),
                id = littleEndian ? parseLittleEndian(idHex) : parseInt(idHex, 16),
                tagsToFindIdx = tagsToFind.indexOf(id),
                tagValHex, tagName, tagValLength;

            if (tagsToFindIdx >= 0) {
                tagName = TAG_INFO[id].name;
                tagValLength = TAG_INFO[id].bytes;
                tagValHex = entry.slice(TAG_VAL_OFFSET, TAG_VAL_OFFSET + (tagValLength * 2));
                vals[tagName] = littleEndian ? parseLittleEndian(tagValHex) : parseInt(tagValHex, 16);

                tagsToFind.splice(tagsToFindIdx, 1);
            }

            if (tagsToFind.length === 0) {
                return false;
            }
        });

        return vals;
    }
function getTagValues(littleEndian, dirEntries) {
        var TAG_VAL_OFFSET = 16,
            tagsToFind = qq.extend([], TAG_IDS),
            vals = {};

        qq.each(dirEntries, function(idx, entry) {
            var idHex = entry.slice(0, 4),
                id = littleEndian ? parseLittleEndian(idHex) : parseInt(idHex, 16),
                tagsToFindIdx = tagsToFind.indexOf(id),
                tagValHex, tagName, tagValLength;

            if (tagsToFindIdx >= 0) {
                tagName = TAG_INFO[id].name;
                tagValLength = TAG_INFO[id].bytes;
                tagValHex = entry.slice(TAG_VAL_OFFSET, TAG_VAL_OFFSET + (tagValLength * 2));
                vals[tagName] = littleEndian ? parseLittleEndian(tagValHex) : parseInt(tagValHex, 16);

                tagsToFind.splice(tagsToFindIdx, 1);
            }

            if (tagsToFind.length === 0) {
                return false;
            }
        });

        return vals;
    }
function getTagValues ( littleEndian , dirEntries ) { var TAG_VAL_OFFSET = 16 , tagsToFind = qq . extend ( [ ] , TAG_IDS ) , vals = { } ; qq . each ( dirEntries , function ( idx , entry ) { var idHex = entry . slice ( 0 , 4 ) , id = littleEndian ? parseLittleEndian ( idHex ) : parseInt ( idHex , 16 ) , tagsToFindIdx = tagsToFind . indexOf ( id ) , tagValHex , tagName , tagValLength ; if ( tagsToFindIdx >= 0 ) { tagName = TAG_INFO [ id ] . name ; tagValLength = TAG_INFO [ id ] . bytes ; tagValHex = entry . slice ( TAG_VAL_OFFSET , TAG_VAL_OFFSET + ( tagValLength * 2 ) ) ; vals [ tagName ] = littleEndian ? parseLittleEndian ( tagValHex ) : parseInt ( tagValHex , 16 ) ; tagsToFind . splice ( tagsToFindIdx , 1 ) ; } if ( tagsToFind . length === 0 ) { return false ; } } ) ; return vals ; }
Obtain values for all relevant tags and return them.
Obtain values for all relevant tags and return them .