0
を得る私のコードです:私は、画像の幅と高さを取得したいとも私は、アップロードされようとしているビデオの解像度を取得したいJavascriptが画像の幅、高さ、ここでは、ビデオの解像度
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);
}
私たちのサーバーに。事前に
おかげ
あなたの質問は何ですか? –
@Div質問は、私は画像の幅と高さ、画像の寸法を取得したいと非常に明確ですか? –
[これを参照してください](http://stackoverflow.com/questions/623172/how-to-get-image-size-height-width-using-javascript) –