0
Hier bekommen ist mein Code:Javascript um die Bildbreite, Höhe und Videos Auflösung
if($('#profileimg').val())
{
var fsize = $('#profileimg')[0].files[0].size; //get file size
var ftype = $('#profileimg')[0].files[0].type; // get file type
if(fsize>5242880)
{
$("#filetype").html("<b> Profile Image "+bytesToSize(fsize) +"</b> <br />File is too big, it should be less than 5 MB.");
return false
}
if(filetypeimage(ftype))
{
var file, img;
if ((file = $('#profileimg')[0])) {
img = new Image();
img.onload = function() {
alert(this.width + " " + this.height);
};
img.onerror = function() {
alert("not a valid file: " + file.type);
};
img.src = _URL.createObjectURL(file);
}
ich die Bildbreite und Höhe erhalten mag, und ich will auch die Auflösung von Video erhalten, die hochgeladen werden soll auf unserem Server.
Vielen Dank im Voraus
Was ist Ihre Frage? –
@Div Frage ist ziemlich klar, ich möchte die Breite und Höhe des Bildes, Image Dimension bekommen? –
[Siehe hierzu] (http://stackoverflow.com/questions/623172/how-to-get-image-size-height-width-using-javascript) –