i use php , framework named "laravel 5.0". there great package gd library, , can resize or add grey filter.
now i'm create web app , use few types of sizes of images such image thumnbnaill, image within navbar, images userlist.
so wonder best practice ?
sure can resize images css/js each time browser outputs page? (but rendering speed must slower.)
or should store path different sizes of image in db ? (but if change interface design in future.)
or better ways approach image handling?
the approach use save original picture alongside resized versions. when change layout , need image sizes emerges, can run script create new sizes based on original picture.
and suggest save database dimensions (width, height) of each variant well. therefore can directly put in html attributes width , height , layout wont bouncing whilst loading.
how save path images you, don't have save path @ - it's sufficient save image name (or use id) , image extension. paths different image sizes may stored in php constants. way avoid duplicity of saving same path in database million times because use easy change constant.
Comments
Post a Comment