Thanks Geek_gurl. I did a Google search which often produces better results that a forum search. I came across this thread which I now recall reading quite a few years ago:
https://www.boonex.com/forums/topic/Delete-Original-Photo-after-upload-resize.htm
It may help people running earlier versions but it doesn't work for 7.2.1.
I modified the code as best I could to suit 7.2.1. and it works perfectly. This could help a lot of people control the massive overheads associated with large images being uploaded.
I'm not a programmer so some geek may like to confirm this.
What the changes do:
- They allow a user to upload a huge image. Depending on your Dolphin Photo Module settings, Dolphin will convert and resize the photo. In my case the resized photo is 700px.
- Without any effort on your part, Dolphin will delete the original from the server. The member's original photo isn't harmed.
- When a member looks at any photo, the can only see the resized one. The button saying "Original" has been removed.
- The savings are enormous. If 100 photos are posted, the disk space saved could be as much as half a gigabyte.
Here's the code for 7.2.1
Warnings 1. Work on a practice site
2. If you reload the Photos Module, you will lose these changes. Keep a copy.
3. back up your database.
-- Open /modules/boonex/photos/classes/BxPhotosUploader.php
-- Add the following line where shown in red. (Line number is approximate)
$Extension = $sExtension;
-- Add the following two lines where shown in red. (Line number is approximate)
$Photo2Delete = $sMediaDir . $iLastID . $Extension;
@unlink($Photo2Delete);
-- Using PHPMyAdmin, do the following query
DELETE FROM sys_objects_actions WHERE Caption = '_bx_photos_action_view_original'
-- Go back to your site, flush the cache and add a large photo.
-- Look at the photo and hopefully the "Original" button won't be there. if it is, reflush the cache.
-- Go to /modules/boonex/photos/data/files and look for the original photo. It shouldn't be there.
-- When you're happy, do the same for your working site, but backup the database first.
All credit to the original author.