Avoiding duplicate copies of pictures

pheitman

Joined: 2009-10-27
Posts: 6
Posted: Tue, 2009-10-27 01:27

I have 18 GBytes of pictures on the same system I'm running Gallery on. I'd really like to have Gallery use those as the source pictures instead of having to 1) *upload* those pictures in to Gallery (they are already on the system) and 2) have Gallery make a copy of those pictures under its var/album directory. Is there any way to do that or am I forced to keep 2*18 GBytes of pictures on the same hard drive?

Login or register to post comments
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 9281
Posted: Tue, 2009-10-27 02:27
Quote:
var/album directory

Are you talking about G2 or G3?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16315
Posted: Tue, 2009-10-27 04:15

If you are not on a windows server you can use the server add with the sym link option.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
pheitman

Joined: 2009-10-27
Posts: 6
Posted: Tue, 2009-10-27 11:55

I'm currently trying out G3, but I really don't care which one I use if I can remove the need for storing the pictures twice.

I'm on a linux server. Will I find any documentation about the "server add with the sym link option" if I search the documentation for G2 or G3?

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 16315
Posted: Tue, 2009-10-27 14:42
Login or register to post comments
pheitman

Joined: 2009-10-27
Posts: 6
Posted: Tue, 2009-10-27 16:11

Thanks for the pointer. I've tried it out and it appears to be half of what I want. It is trivially easy to add albums from the server - but it appears to be still making copies of the pictures. I'm adding from /shared/Media/Pictures/<album> and after it does that I end up with a copy of it in /shared/Gallery3Data/albums/<album>. Checking inodes makes it look like they are copies. It certainly isn't symlinked. Is there something more I need to do?

Login or register to post comments
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 9281
Posted: Tue, 2009-10-27 16:37

If you're using G3, yes, it makes copies. There is no option to create symlinks with G3 yet. If you're using G2 with the symlink option on Linux, then no, it doesn't make a copy, it creates a symlink to the original file. It will still generate the resized and thumbnail versions though.

If you're using G2, do an ls -al of one of your Gallery3Data/albums/<album> directories and post the output here.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

Login or register to post comments
pheitman

Joined: 2009-10-27
Posts: 6
Posted: Tue, 2009-10-27 17:04

Thanks for the reply. I'll uninstall G3 and switch to G2. This feature is more important to me than testing the latest beta!

Login or register to post comments
pheitman

Joined: 2009-10-27
Posts: 6
Posted: Wed, 2009-10-28 02:37

I just figured out the answer to my question below. I was trying to put the g2data on the /shared (nsf mounted) directory *and* trying to symlink to files on /shared/Media/Pictures. I moved the g2data on to /var (local). Since I'm going to be symlinking I don't expect that I will have too much data there (as compared with the pictures themselves).

** Original question **

So I've uninstalled G3 and installed G2. Trying to use the symlink feature (on ubuntu) leads to the following debug output: Any idea what function.symlink: operation not permitted means?

Error (ERROR_PLATFORM_FAILURE)

* in modules/core/classes/GalleryDataItem.class at line 173 (GalleryCoreApi::error)
* in modules/core/classes/GalleryPhotoItem.class at line 104 (GalleryDataItem::create)
* in modules/core/classes/helpers/GalleryItemHelper_medium.class at line 148 (GalleryPhotoItem::create)
* in modules/core/classes/GalleryCoreApi.class at line 1668 (GalleryItemHelper_medium::addItemToAlbum)
* in modules/itemadd/ItemAddFromServer.inc at line 313 (GalleryCoreApi::addItemToAlbum)
* in modules/itemadd/ItemAddFromServer.inc at line 190 (ItemAddFromServer::addItem)
* in modules/core/ItemAdd.inc at line 159 (ItemAddFromServer::handleRequest)
* in ??? at line 0 (ItemAddController::handleRequestWithProgressBar)
* in modules/core/classes/GalleryTemplateAdapter.class at line 1092
* in /shared/Gallery2Data/smarty/templates_c/%%626616196/matrix/%%3A^3A8^3A818B59%%theme.tpl.php at line 75 (GalleryTemplateAdapter::trailer)
* in /usr/share/php/smarty/Smarty.class.php at line 1255
* in modules/core/classes/GallerySmarty.class at line 61 (Smarty::fetch)
* in modules/core/classes/GalleryTemplate.class at line 241 (GallerySmarty::fetch)
* in main.php at line 506 (GalleryTemplate::display)
* in main.php at line 104
* in main.php at line 88

Continue...

Warning: symlink() [function.symlink]: Operation not permitted in /usr/share/gallery2/modules/core/classes/GalleryPlatform.class on line 88

Login or register to post comments
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 9281
Posted: Wed, 2009-10-28 02:30

Looks like your host is probably restricting that. Post a link to phpinfo:
FAQ: How do I create a phpinfo page?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

Login or register to post comments
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 9281
Posted: Wed, 2009-10-28 02:50

New comment...

Quote:
I just figured out the answer to my question below. I was trying to put the g2data on the /shared (nsf mounted) directory *and* trying to symlink to files on /shared/Media/Pictures. I moved the g2data on to /var (local). Since I'm going to be symlinking I don't expect that I will have too much data there (as compared with the pictures themselves).

There will still be quite a bit in g2data. g2data contains the resized versions, thumbs, cache and some module dependent stuff like some files for download by visitors for the slideshow (for one example).
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

Login or register to post comments
pheitman

Joined: 2009-10-27
Posts: 6
Posted: Thu, 2009-10-29 01:26

Thanks for the replies. I basically got it working, but then decided that since I'm running gallery in a VM with a limited amount of disk I may be better off without the symlinks. Adding from the server is still the right approach (since the originals for the albums are on a mounted directory), but I'll just have to live with the space the copies take up. On the plus side, I am free to rearrange the sources all I want without having to worry about breaking the symlinks.

Login or register to post comments
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 9281
Posted: Thu, 2009-10-29 03:33

Not only that, but you can retain the originals and and use the Size Limit module to resize the full size images that get imported into Gallery so they don't take up as much space.
http://codex.gallery2.org/Gallery2:Modules:sizelimit
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

Login or register to post comments