Panorama module for G3

View: New views
2 Messages — Rating Filter:   Alert me  

Panorama module for G3

by Mike Miller-19 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I've been playing around with the beta (actually, the latest git
release as of several hours ago), and am really impressed by the speed
of G3 vs. G2 (even allowing for the fact that I'm proxying to Apache
instead of running directly from NGINX). The import worked really
well, and I'm looking forward to porting my theme to G3 (really just a
wrapper to put my header and left sidebar around the gallery section).

The one thing I need that isn't in G3 (yet) is a panorama module. I
have a bunch of panoramas which I'm displaying via a customized
version of the panorama module for G3 (it uses a Flash viewer from
http://pan0.net/fspp, which I modified for partial panorama support).
I was thinking of trying to tackle this myself, but I'm looking for
some guidance on where to start (I've never worked with kohana, or any
MVC framework before, although I do have extensive experience in C
programming, as well as a pretty decent grasp of PHP).

In order to implement a panorama viewer in a similar fashion to that
of G2, I need to do two things. First, the full size image should be
rendered by a different wrapper (instead of img src, it's a parameter
passed to the flash viewer), and not shown via the lightbox effect.
Second, I need to store three pieces of information in the DB for each
picture (whether it's a panorama, and if so, the horizontal FOV and
the vertical FOV).

Any suggestions for where to start, or similar functionality in an
existing module?

Thanks

-- Mike

P.S. Incidentally, I discovered that by editing
modules/g2_import/helpers/g2_import.php and changing the call to
photo::create to receive a hard coded path to a sample image, the
import runs a lot faster when the images are actually stored remotely
(I use s3fs to store my pictures, which are primarily write only, and
barely read <g>). Once the import is complete, I just deleted the
albums directory and mounted my g2 albums directory on top of it!

------------------------------------------------------------------------------
__[ g a l l e r y - d e v e l ]_________________________

[ list info/archive --> http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download --> http://gallery.sf.net ]

Re: Panorama module for G3

by Bharat Mediratta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry to take so long to respond to this.  I've been busy travelling and
getting beta 2 out the door.

Mike Miller wrote:

> I've been playing around with the beta (actually, the latest git
> release as of several hours ago), and am really impressed by the speed
> of G3 vs. G2 (even allowing for the fact that I'm proxying to Apache
> instead of running directly from NGINX). The import worked really
> well, and I'm looking forward to porting my theme to G3 (really just a
> wrapper to put my header and left sidebar around the gallery section).
>
> The one thing I need that isn't in G3 (yet) is a panorama module. I
> have a bunch of panoramas which I'm displaying via a customized
> version of the panorama module for G3 (it uses a Flash viewer from
> http://pan0.net/fspp, which I modified for partial panorama support).
> I was thinking of trying to tackle this myself, but I'm looking for
> some guidance on where to start (I've never worked with kohana, or any
> MVC framework before, although I do have extensive experience in C
> programming, as well as a pretty decent grasp of PHP).
>
> In order to implement a panorama viewer in a similar fashion to that
> of G2, I need to do two things. First, the full size image should be
> rendered by a different wrapper (instead of img src, it's a parameter
> passed to the flash viewer), and not shown via the lightbox effect.
> Second, I need to store three pieces of information in the DB for each
> picture (whether it's a panorama, and if so, the horizontal FOV and
> the vertical FOV).

Let's start with the second problem first.  To store extra data in the
database, you'll need to create your own module.  Right now we don't
have a way for you to hook into the existing "Edit Photo" dialog.  We
will eventually, but for now you'll need to do the following:

1) Create your own module (the "developer" module from the
gallery3-contrib repo is very helpful for this)

2) Create a database table to store your per-item data (which you'd do
in your xxx_installer.php file)

3) Create your own menu button under the "Options" menu.  See
modules/organize/helpers/organize_menu.php for a simple example of this

4) Create a model class so that you can access your database table using ORM

5) Create your own controller to show your form using Forge

6) Create a controller method that takes the data and stores it in the
database using the ORM class.

That will get you to the point where you have the data that you need.
Now the next problem is, figuring out when you should display a panorama
instead of a regular image.  There are two ways I can think of, offhand,
to do that:

1) Write your own theme, then when it comes time to draw the image,
check your database table to see if you have FOV entries and if you do,
show the panorama version instead of the regular tag.

2) In your module's xxx_theme.php file, override photo_bottom() and if
you detect FOV fields, use JS to rewrite the page to use your
imageloader instead of the <img> tag.

I'm thinking that approach #2 would work better here.  If you're daunted
by the 6 step process to create your module, you might talk to rWatcher
in the forums and collaborate with him-- he's already written a bunch of
community modules.  If that doesn't work, let me or Tim know and we can
find some time to make a skeleton module for you to hack on.

-Bharat



------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
__[ g a l l e r y - d e v e l ]_________________________

[ list info/archive --> http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download --> http://gallery.sf.net ]