How to maintain the dpi (dots per inch) of an image in laravel 5.2 using intervention package?

旧巷老猫 提交于 2019-12-12 06:25:06

问题


I am using Laravel 5.2. I have almost done the resizing of an image that runs fine. But i am facing one problem When i upload an image of 300 dpi it reduces the dpi to 96 dpi. I don't know what i am doing wrong.I am using Intervention Package of laravel5.2. Here i have done so far:-

// Input::file('image') -> upload file having dpi of 300
$height = 6048; //upload image height
$width = 4032;  //upload image width
xxlheight = ($height*60)/100;
$xxlwidth = ($width*60)/100;
$xxlFileName = str_random(4)."xxl".str_random(4).".".$extension;
Image::make(Input::file('image'))->resize($xxlwidth,$xxlheight)->save(storage_path('app/images/secureRealImages/'.$xxlFileName));
$getxxlimage = Image::make(storage_path('app/images/secureRealImages/'.$xxlFileName));

PLease Help me what i am doing wrong. Thanks in advance :)

来源:https://stackoverflow.com/questions/44456351/how-to-maintain-the-dpi-dots-per-inch-of-an-image-in-laravel-5-2-using-interve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!