What Photos does Dolphin Save?

Does Dolphin always save the original photo or is there some automated way of not saving it?

I recall one site having an admin option "Allow user to view original?" By switching this option off, the original wasn't saved. I thought it was Dolphin, but I can't find that option any more.

 

With people uploading 3 plus meg photos from their devices, my limited storage will be quickly filled on what will be a photo intensive site. I've limited my photo viewing to 700px and as far as I'm concerned, that's big enough.

 

However, when I click View Original, the full 3 meg photo appears.

 

How can I have the original photo automatically deleted when it's been converted? I don't want it taking up space on my site. If this feature doesn't exist, I'm prepared to hard code a core file with someone's code help.

Quote · 17 Feb 2016

You need to edit the code.  Do some searches on the forum; you may have to limit it to Dolphin 7.1.x, for not saving original as I recall this was discussed before.

Geeks, making the world a better place
Quote · 18 Feb 2016

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.

first line.jpg · 26.6K · 422 views
second line.jpg · 32.4K · 405 views
Quote · 18 Feb 2016

The new HTML5 uploader (Multi-uploader) can resize photos on user side, so as the result the original image is limited to 2048x2048 size, you can change this option in Photos module settings:

Width For Photo Resizing In Browser (In Pixels)

Height For Photo Resizing In Browser (In Pixels)

It's better to disable other upload options, so your images will be always limited in size.

Rules → http://www.boonex.com/terms
Quote · 20 Feb 2016

Thanks AlexT. That works and now I know what those parameters are for. I'd certainly recommend that approach for the feint-hearted, but it still leaves two identical photos in the album: Original.jpg and Original_m.jpg.

 

I agree that the new original is around 50-70kb compared to 3 meg, but if space is at a premium, deleting the original may still be a viable option. That's the path I've chosen for the time being.

 

Thanks again.

Quote · 22 Feb 2016

A couple of important additions to my suggested mod and AlexT's comments (above).

 

It's probably best that you follow AlexT's advice because a few routines actually use the original photo. If you use my mod suggestion, the CROP function will no-longer work. It uses the original to make the crop. This is logical and reducing the image size as AlexT pointed out can also affect the quality of your cropped images. I've decided the quality loss is worth the disk space savings, but you may have a different opinion.

It's also possible (unconfirmed) that the Profile cover image may not display. By removing the original image I had problems with a 3rd party Profile Cover module, but the problem was resolved when I reverted to AlexT's suggestion.

 

Quote · 20 Mar 2016
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.