Category Archives: Gallery 3

Gallery 3 posts

Amazon S3 CDN distribution for Menalto Gallery 3 v2.1 released

Announcing the release of the Amazon S3 v2.1 module for Gallery 3. A few changes are presented here;

  • Firstly, started using double digits for version numbers so I can create minor revisions
  • Added fields to database to store MD5 hashes of files. These are used to match the MD5 hash of the local file, and what the module thinks is uploaded, and also for comparison with S3 itself (which provides an MD5 hash when asked for bucket info)
  • Re-visited re-sync task. Taken out “emptying bucket” code (as there’s really no need it seems), and simplified the whole process, allowing the module to compare the MD5 hash of the local file against the same file path on S3, and upload/overwrite if they’re different, or if the module doesn’t believe the file has been uploaded.
  • Resolved issues of moving entire albums from one location to another and files disappearing. This invoked a re-visit of the move code as well and cleaned up quite a lot of unnecessary stuff.

Download the latest version here: Amazon S3 for Gallery 3 : v2.1 (md5: )
As always, direct comments, feedback and bug reports to the module’s official thread on Gallery’s forums.

Note: I will no longer be updating the gallery3-contrib git repository as it’s just easier to update my site than it is to update a load of other places and wait for pulls to be granted. Sorry.

Amazon S3 CDN distribution for Menalto Gallery 3 v2 released

Well, after a few weeks of having this module used by many in the community as a beta module, and due to lack of bug reports since, I’m now convinced it’s stable enough to release. So, here it is.

Amazon S3 for Gallery 3 : v2.1 (md5: )

As always, direct comments, feedback and bug reports to the module’s official thread on Gallery’s forums.

That is all :)

Amazon S3 CDN distribution for Menalto Gallery 3 v2 BETA

I just posted beta version 2 of this module on the G3 forum. As I wrote there, but will write here too, here’s the changelog:

  • Access Key, Secret Key, and Bucket name validation
  • Ability to upload only thumbs, resizes, fullsizes, or any combination of the 3
  • Resolved compatibility with crossdomain issue in album organize. Thumbs are now vended from the local server as crossdomain blocks flash from loading these (though CoolIris is not affected, I’m not sure why)
  • Ability to (if used with updated Scheduler module (linked below)) sync and upload items to S3 via a cron job rather than “there-and-then”. This resolves the upload progress bar stalling/freezing/browser crashing issues while waiting for server to upload to S3
  • Spelling changes
  • Updated S3 lib to ignore SSL certificate mismatches. This resolves communicating data to S3 via SSL if required. The warning is still in place on the admin page though, as you may or may not still run into issues using SSL
  • Added support to move items around S3 when items are moved around the G3 installation. When images are now moved from album to album, the item is moved in S3 accordingly. Images are also updated on S3 when rotated. Haven’t tested this with the Watermark module yet though.
  • Resolved problem validating Access Key/Secret Key/Bucket Name info on first/new install of module (not affecting upgraders from version 1 of this module)
  • Resolved issues with Organize crashing as (0 of x items completed) when moving items between albums.
  • (Potentially) resolved issues that prevented Server Add module from working correctly.

Yet to come:

  • Use S3 for primary storage (useful for low-storage hosting accounts) – This is pegged for v3

You can download it here: Amazon S3 for Gallery 3 : v2.1 (md5: )

Please direct all feedback and bug reports to the thread on G3′s forum here.

Amazon S3 CDN distribution for Menalto Gallery 3

Announcing a new module for Gallery 3 by Bluespider Technical Solutions: Amazon S3 CDN

This module integrates deeply into the Gallery 3 code, and seamlessly redirects your web clients to your Amazon S3 bucket for content, leaving your web server only the task of serving up the Gallery 3 HTML pages. This module also hooks into item upload, move and delete events and copies, moves or deletes content from your S3 bucket as and when you create, move or delete it.

For galleries with content pre-added, we provide a task which performs a syncronisation between Gallery 3 and the S3 bucket for all content and album thumbnails, resizes and full sized images that would have otherwise been served up by Gallery 3.

Download it here: Amazon S3 for Gallery 3 : v2.1 (md5: )
Gallery Codex page here
HISTORICAL Support Forum Thread here
Use the comment box at the bottom of this page for support, or contact me directly. I’d rather you commented in the open forum though, since this is open source and all :)

Changelog
26th November 2010 :: Version 1 :: Initial release.
19th December 2010 :: Version 2 (beta)

  • Key, and Bucket name validation
  • Ability to upload only thumbs, resizes, fullsizes, or any combination of the 3
  • Resolved compatibility with crossdomain issue in album organize. Thumbs are now vended from the local server as crossdomain blocks flash from loading these (though CoolIris is not affected, I’m not sure why)
  • Ability to (if used with updated Scheduler module (linked below)) sync and upload items to S3 via a cron job rather than “there-and-then”. This resolves the upload progress bar stalling/freezing/browser crashing issues while waiting for server to upload to S3
  • Spelling changes
  • Updated S3 lib to ignore SSL certificate mismatches. This resolves communicating data to S3 via SSL if required. The warning is still in place on the admin page though, as you may or may not still run into issues using SSL
  • Added support to move items around S3 when items are moved around the G3 installation. When images are now moved from album to album, the item is moved in S3 accordingly. Images are also updated on S3 when rotated. Haven’t tested this with the Watermark module yet though.
  • Resolved problem validating Access Key/Secret Key/Bucket Name info on first/new install of module (not affecting upgraders from version 1 of this module)
  • Resolved issues with Organize crashing as (0 of x items completed) when moving items between albums.
  • (Potentially) resolved issues that prevented Server Add module from working correctly.

20th January 2011 :: Version 2 Final :: Release
29th January 2011 :: Version 2.1

  • Firstly, started using double digits for version numbers so I can create minor revisions
  • Added fields to database to store MD5 hashes of files. These are used to match the MD5 hash of the local file, and what the module thinks is uploaded, and also for comparison with S3 itself (which provides an MD5 hash when asked for bucket info)
  • Re-visited re-sync task. Taken out “emptying bucket” code (as there’s really no need it seems), and simplified the whole process, allowing the module to compare the MD5 hash of the local file against the same file path on S3, and upload/overwrite if they’re different, or if the module doesn’t believe the file has been uploaded.
  • Resolved issues of moving entire albums from one location to another and files disappearing. This invoked a re-visit of the move code as well and cleaned up quite a lot of unnecessary stuff.

YouTube-esq module for Menalto Gallery v3

I’ve been using Gallery2 on my site now for a few years now. I’ve always had issues with it though, due to it’s somewhat overwhelming complexity, the templating system which I really couldn’t even get a grasp of, and based on some framework I really didn’t understand, I got reluctant to attempt to do anything with the code in the way of writing modules for it. That and file permissions issues plagued my gallery and stopped it working on several occasions.

So I read that Gallery3 was almost ready, and installed the RC2 version. It’s much better in the terms of the way it’s built. It’s modules are simpler to write with a somewhat simple ‘hooks’ based system which actually make extending it’s functionality and hooking into the theme’s areas relatively easily.

One of the main things that I’ve always wanted to do is have my videos stored on my Gallery instead of on YouTube. I get more web-visitor stats from the server, Gallery, and Google Analytics – something I don’t get with YouTube. However, G3 doesn’t support this out of the box. So I wrote one. It’s a somewhat basic implementation of what I eventually want it to be. The biggest part of this for me was trying to get to grips with Gallery3′s new framework (based on Kohana). I figured most of it out by copying the basic structures of other modules I’d installed and modifying it for me own needs. A couple of hours and I’d picked it up relatively easily.

You can download it here: Video Transcode for Gallery 3

I probably shouldn’t be doing this, but in the interest of avoiding dead links, I’ve been updating this post during the development of this module as opposed to posting a new post each time there was a new version.

A couple of things you should note however. If you want to upload a video of more than a couple of megabytes, use the ‘Server Add’ module, as the upload will eventually stall/time out/crash as the transcoding process takes a while. You can check the progress of each of the transcoding tasks (one task for each resolution) in the Maintenance tab of the Admin area. If you see a task as ‘Stalled’, it means ffmpeg has either crashed, or that particular installation doesn’t like one (or more) of the parameters in the command sent to ffmpeg for transcoding.

It currently logs a decent amount of data to var/modules/transcode/log/transcode.log. This is the general output of the module behind the scenes. If a problem arises, this is the first place to look. Also, it logs ffmpeg’s output to a separate file (this is for 2 purposes, one so we can see what ffmpeg is doing having been executed from php/apache, and secondly so the module can work out how far into the transcoding process it is). Here, there’s one log file for each transcode/ffmpeg process.

If you can’t figure out why things aren’t working, drop me a line here, my Contact page, or on the Menalto forum here. I don’t expect this to be perfect, and it’s my first contribution to any open source project, so don’t shoot me down too hard :)

Dan

Download here: Video Transcode for Gallery 3

Change Log
7th October 2010 :: Version 1 :: Initial release.
8th October 2010 :: Version 2 :: Removed dependency on php5-ffmpeg, refine audio codec selection list, add support for ffprobe to detect input video’s parameters.
10th October 2010 :: Version 3 :: Removed dependency on ffprobe, improved audio codec detection.
25th October 2010 :: Version 5 :: This module actually starts working on servers other than my own!
28th October 2010 :: Version 6 :: Fixed a bug that makes ffmpeg fall over if the input video’s audio sample resolution is not supported by ADPCM. It now fixes the sample rate to one of 11025 kHz, 22050 kHz or 44100 kHz (whichever is the next lower than the input sample rate).
30th October 2010 :: Version 7 :: Fixed issues providing an ffmpeg path and not saving correctly when no audio codecs are in the select list to begin with.
1st November 2010 :: Version 8 :: Bug fixes, thanks to netprince for the patch, and diverselab, jhend60, shecter and mamouneyya for help getting this working.
3rd November 2010 :: Version 9 :: Final stable release. Fixed issues with crashing due to ffmpeg not detecting/recognising the input file’s audio codec.
11th November 2010 :: Version 10 :: Bitrate tweaks and fix to audio bitrate channel detection and calculation.
13th September 2012 : Version 11 : Applied patch to prevent “Alternative Resolutions” banner appearing on photo pages and pages where transcoding has not been carried out (patch provided by Jannik Graversen).
15th September 2012 : Version 12 : Update codebase, cleanup, fix parsing of ffmpeg output to determine codec support. Utilise ffprobe to get details of source video as it provides a JSON interface. Added “Default Resolution” field, to auto-select on the frontend as opposed to the smallest resolution available. Only display “Alternative Resolutions” if 2 or more resolutions are available. Improvement on the back of patch from v11, using item->is_movie as opposed to counting resolutions to determine whether or not to display that area. Tested with ffmpeg version 0.6.5 through 0.11.1.
17th September 2012 : Version 13 : Fix versioning issue in installed, problem preventing save after upgrade or clean install.

Codex page on Gallery’s website: http://codex.gallery2.org/Gallery3:Modules:transcode