php - Which is the better way to manipulate an image, using gd lib or using the FileReader() with Jcrop? -
i trying resize , crop image on php page. either want use gd lib or jcrop filereader(). better wat go. pros/cons ?
jcrop
, filereader()
both frontend browser library or api,while gb lib
php backend library.
i have 2 solutions fyi.
jcrop
+filereader()
user crop image,and frontend new cropped image's data{x:50,y:100,width:100,height:200}
relative original image,which posted backend php processgb lib
(imagecrop
function).
pros: balance both frontend , backend performance. cons: code looks more complicated
- only
jcrop
+filereader()
user crop image,and them frontend new cropped image's base64 string,then post server.server no need callgb lib
crop.just decode base64 image , save file.
pros: code looks more simple. cons: increase frontend pressure. save bandwidth (no need upload original image)
finally,up add more logic in frontend or backend.
Comments
Post a Comment