JSFiddle - React, Tailwind, and code Playground
HTML
<form id="myform">
<input type="file" id="file" /><br>
<label>Camera Model</label>
<input type="text" name="cameraModel" id="cameraModel" /><br>
<label>camera Lens</label>
<input type="text" name="cameraLens" id="cameraLens" /><br>
<label>Version</label>
<input type="text" name="version" id="version" /><br>
<label>Exposure Time</label>
<input type="text" name="exposureTime" id="exposureTime" /><br>
<label>Aperture</label>
<input type="text" name="aperture" id="aperture" /><br>
<label>Flash</label>
<input type="text" name="flash" id="flash" /><br>
<label>Focal distance</label>
<input type="text" name="focalDistance" id="focalDistance" /><br>
<label>ISO/Pelicula</label>
<input type="text" name="iso" id="ISO" />
</form>
JavaScript
(function($) {
var BinaryFile = function(strData, iDataOffset, iDataLength) {
var data = strData;
var dataOffset = iDataOffset || 0;
var dataLength = 0;
this.getRawData = function() {
return data;
};
if (typeof strData == "string") {
dataLength = iDataLength || data.length;
this.getByteAt = function(iOffset) {
return data.charCodeAt(iOffset + dataOffset) & 0xFF;
};
} else if (typeof strData == "unknown") {
dataLength = iDataLength || IEBinary_getLength(data);
this.getByteAt = function(iOffset) {
return IEBinary_getByteAt(data, iOffset + dataOffset);
};
}
this.getLength = function() {
return dataLength;
};
this.getSByteAt = function(iOffset) {
var iByte = this.getByteAt(iOffset);
if (iByte > 127)
return iByte - 256;
else
return iByte;
};
this.getShortAt = function(iOffset, bBigEndian) {
var iShort = bBigEndian ?
(this.getByteAt(iOffset) << 8) + this.getByteAt(iOffset + 1) : (this.getByteAt(iOffset + 1) << 8) + this.getByteAt(iOffset);
if (iShort < 0) iShort += 65536;
return iShort;
};
this.getSShortAt = function(iOffset, bBigEndian) {
var iUShort = this.getShortAt(iOffset, bBigEndian);
if (iUShort > 32767)
return iUShort - 65536;
else
return iUShort;
};
this.getLongAt = function(iOffset, bBigEndian) {
var iByte1 = this.getByteAt(iOffset),
iByte2 = this.getByteAt(iOffset + 1),
iByte3 = this.getByteAt(iOffset + 2),
iByte4 = this.getByteAt(iOffset + 3);
var iLong = bBigEndian ?
(((((iByte1 << 8) + iByte2) << 8) + iByte3) << 8) + iByte4 : (((((iByte4 << 8) + iByte3) << 8) + iByte2) << 8) + iByte1;
if (iLong < 0) iLong += 4294967296;
return iLong;
};
this.getSLongAt = function(iOffset, bBigEndian) {
var iULong = this.getLongAt(iOffset, bBigEndian);
if (iULong >...