jquery.exif不从显示的照片加载exif数据
我无法从显示的图像地址获取exif数据 通过点击照片,您应该可以看到exif数据jquery.exif不从显示的照片加载exif数据,exif,Exif,我无法从显示的图像地址获取exif数据 通过点击照片,您应该可以看到exif数据 var someCallback = function(e) { $('#cameraModel').val(e.Model); $('#aperture').val(e.FNumber); $('#created').val(e.DateTime); $('#taken').val(e.DateTimeOriginal); $('#copyright').val(e.Cop
var someCallback = function(e) {
$('#cameraModel').val(e.Model);
$('#aperture').val(e.FNumber);
$('#created').val(e.DateTime);
$('#taken').val(e.DateTimeOriginal);
$('#copyright').val(e.Copyright);
$('#description').val(e.ImageDescription);
$('#artist').val(e.Artist);
$('#latitude').val(e.GPSLatitude[2]);
$('#longitude').val(e.GPSLongitude[2]);
//Uncomment the line below to examine the
//EXIF object in console to read other values
//console.log(e);
}
$('#fdd').on('click', function (e) {
alert($(this).attr("src"));
$(this).fileExif(someCallback);
});
请帮忙 在fiddle中,您试图使用来自的fileExif方法。这里有几个问题:
- 您没有在小提琴中加载库(因此我不得不猜测您尝试使用的库。提示:阅读控制台日志,会出现类似
的消息,表示您缺少代码或尝试调用错误的对象)uncaughttypeerror:Object[Object Object]没有方法“fileExif”
- 该库无法加载到小提琴中,因为它使用document.write。您可以从插件中删除此代码,以使其能够正常工作;它只适用于IE:
document.write(
“\r\n”
+函数IEBinary\u getByteAt(标准二进制,iOffset)\r\n
+IEBinary\u getByteAt=AscB(MidB(标准二进制,iOffset+1,1))\r\n
+“结束函数\r\n”
+“函数IEBinary\u getLength(标准二进制)\r\n”
+“IEBinary\u getLength=LenB(标准二进制)\r\n”
+“结束函数\r\n”
+“\r\n”
);
- 你用错了图书馆。这是一个文件上传,而不是图像元素。您应该尝试使用原始的jquery exif插件,如下所示:
document.write(
"<script type='text/vbscript'>\r\n"
+ "Function IEBinary_getByteAt(strBinary, iOffset)\r\n"
+ " IEBinary_getByteAt = AscB(MidB(strBinary,iOffset+1,1))\r\n"
+ "End Function\r\n"
+ "Function IEBinary_getLength(strBinary)\r\n"
+ " IEBinary_getLength = LenB(strBinary)\r\n"
+ "End Function\r\n"
+ "</script>\r\n"
);