phppup Posted 8 hours ago Share Posted 8 hours ago Some time ago I was playing with PHP code to minimize the size of images. My primary purpose was to reduce the file size so that uploading would be quicker and thereby encounter fewer instances of exceeding the upload limits of the hosting server. It recently occurred to me that this was a futile exercise because once PHP was involved, the files at full size had already engaged with the server. Am I correct in my assumption? Is there a reliable way to approach what I had initially intended? Quote Link to comment https://forums.phpfreaks.com/topic/327295-reduce-file-size-before-upload/ Share on other sites More sharing options...
Strider64 Posted 7 hours ago Share Posted 7 hours ago I use Intervention using composer which is a very handy utility. // Load the image $image = Image::make($image_path); // Resize the image $image->resize(2048, 1365, function ($constraint) { $constraint->aspectRatio(); $constraint->upsize(); }); // Save the new image $image->save($image_path, 100); You can do other image manipulation with Intervention as well and pretty easily. I don't know if this is something you are looking for? Quote Link to comment https://forums.phpfreaks.com/topic/327295-reduce-file-size-before-upload/#findComment-1652838 Share on other sites More sharing options...
phppup Posted 5 hours ago Author Share Posted 5 hours ago @Strider64 I think my intention (at first, anyway) was to increase upload speed (especially if a few images were involved) and avoid upload size maximum limits (that the server /hosting service enforces). Will this actually address the issue? Is there another reliable resolution? Quote Link to comment https://forums.phpfreaks.com/topic/327295-reduce-file-size-before-upload/#findComment-1652839 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.