I am currently using Amazon S3 to host all my images for my Wordpress site. But I need a gallery and I love what I see at Piwig. However my host is very basic and too slow in my opinion.
Is there a way to use Amazon S3 for the source for my images? I can automate (cron job) the replication of my images from Piwig to Amazon S3, but I am not sure if there is a plugin to or a way to substitute the image URL for the Amazon copy.
Any ideas?
Offline
Hi fotochuk,
I don't know yet how Amazon S3 works. Do you have an HTTP location for each of your files stored on S3? If yes, you can replace the images.path column in the database.
Offline
I think the fastest way is to use "remote sites" in piwigo
- look at tools/create_listing_file.php and create the output of this script on your S3 bucket
- piwigo will load this output from S3 and create links to S3
Offline
rvelices wrote:
I think the fastest way is to use "remote sites" in piwigo
Considering the thumbnail and high definition URL are calculated from the "web size" images.path value, isn't it a problem for S3?
Offline
plg wrote:
rvelices wrote:
I think the fastest way is to use "remote sites" in piwigo
Considering the thumbnail and high definition URL are calculated from the "web size" images.path value, isn't it a problem for S3?
No because there is a standard file structure on S3.
However probably the best solution overall would be to change the hoster to a faster one.
Offline
rvelices wrote:
I think the fastest way is to use "remote sites" in piwigo
- look at tools/create_listing_file.php and create the output of this script on your S3 bucket
- piwigo will load this output from S3 and create links to S3
When I try this, I get an error that isn't very helpful.
"an error occurred :"
Offline
plg wrote:
Hi fotochuk,
I don't know yet how Amazon S3 works. Do you have an HTTP location for each of your files stored on S3? If yes, you can replace the images.path column in the database.
The easiest way to explain it is probably explain how it works in wordpress. There are now several plugins that all essentially do the same thing.
1. you let wordpress behave normally and it saves media files on its normal server as expected.
2. you have a plugin or in my case an sh script that selectively copys/syncs certain file types and directories to amazon S3.
3. you have a Cname DNS entry on your host to the amazon S3 directory.
4. you have a plugin (can be the same one as number 2) that selectively replaces URLs in HTML for the S3 version of the URL.
This makes loading photos really fast compared to a shared hosting service. My intent with pwigo is to do the same above but for all JPG, JPEG, CSS and JS files.
Unfortunately I am really a rookie at PHP. I can extend my SH script on number 2 to Piwigo no problem. But swapping out the URLs for the in the PHP is beyond me.
There are two urls below that link to the same photo, one from my shared server and the other from amazon. you can also see the URL I used in the CNAME entry to keep the files looking like they belong to my site.
shared host jpg
Amazon S3 jpg
the post that has jpg source substituted.
Offline
Up!
Is there any update on this? An extension to replace image.path would be perfect!
Piwigo really does need good cloud support (Amazon AWS/S3, others) as well as really well oiled CDN support via a plugin or in the core.
This will take it to the next level for people to slap it in and have it scale easily out of the box using new technologies.