这是我用来上传图片的代码。如何限制codeigniter中的上传图像比例为16:9?
$this->load->library('upload');
$ext = pathinfo($file_name, PATHINFO_EXTENSION);
$img_name = now() . "." . $ext;
$imgConfig['upload_path'] = $this->image_path;
$imgConfig['file_name'] = $img_name;
$imgConfig['max_size'] = '2048';
$imgConfig['allowed_types'] = 'jpg|png|bmp';
$imgConfig['overwrite'] = FALSE;
$this->upload->initialize($imgConfig);
if ($this->upload->do_upload("image_url")) {
$this->Playlist_model->update_playlist($insert_id, array("image_url" => $img_name));
}
以及前端是一个简单的
<input type = 'file' >
的问题是,由于图像载应该是一个视频缩略图,我应该怎么做来实现上传?例如在前端使用插件来限制/裁剪(任何推荐)
另外,在服务器端,我该如何检查?
尝试此[链接](http://stackoverflow.com/questions/3255773/php-crop-image-to-fix-width-and -height-without-loss-dimension-ratio) – Bugfixer
and this [link](http://stackoverflow.com/questions/7319304/resizing-and-cropping-image-with-gd-while-retaining-aspect-ratio) – Bugfixer
谢谢,链接似乎保持图像比例和调整大小,任何情况下特定的16:9? – user782104