Friday, March 22, 2013

V3.0 Beta Refreshed

Today I released an updated beta version of Gallery Server Pro 3.0. Get it here:

Download Gallery Server Pro 3.0 Beta
Download Gallery Server Pro 3.0 Beta (source code)

See a demo of the beta here.

There is no support for upgrading an earlier beta. Delete the first beta and install this anew.

NOTE: An authentication cookie left over from the beta can trick the new version into thinking you are logged on, causing a problem when it can’t find a record for the user in the database. To prevent this, log out of your browser before deleting the beta.

The refresh includes these changes:

  • Many bug fixes, including most or all of the ones reported in the beta forum.
  • Changed upload page to use plUpload 1.5.6. (The 2.0 beta had some stability issues.)
  • Replaced the HTTP handler that receives file uploads to use an architecture based on Rick Strahl’s excellent Westwind.plUploadHandler.
  • Switched to a thread-safe architecture for storing albums and media objects in cache.
  • Albums are automatically resorted when objects are added via synchronizations and file uploads.
  • ZIP file uploads are extracted and processed asynchronously instead of forcing the user to wait.
  • Modified the architecture of the next/previous workflow so that the MediaObject UI template has access to all metadata items. That is, you can use the new jsRender function findMetaItem(metaId) to grab any meta item. Read this thread for an example.
  • Improved robustness of synchronization.
  • Improved performance when setting the privacy of an album. The action now occurs asynchronously.

Thursday, March 14, 2013

Gallery Server Pro 3.0 Beta Released!

I can’t tell you how excited I am to be releasing the beta of the groundbreaking 3.0 release of Gallery Server Pro. Two years in the making, it offers a beautiful user interface that is easy to use while giving administrators power and flexibility that no other digital asset management program offers.

Download Gallery Server Pro 3.0 Beta
Download Gallery Server Pro 3.0 Beta (source code)

See a demo of the beta here.

Be sure to add the Download Gallery Server Pro Binary Pack to get video/audio encoding, better thumbnail extraction, and more.

gsp_v3_beta1

Here is a quick rundown of the features:

  • UI completely rewritten using modern HTML5/CSS3
  • Three-pane layout minimizes scrolling
  • UI is rendered from customizable jsRender templates. Templates can target individual albums.
  • Video now encoded to H.264 MP4 video by default, allowing video to render on iOS, Android, and Microsoft ecosystems
  • Ability to tag media and albums, then create virtual albums matching those tags.
  • Apply properties to media and albums (editable metadata)
  • Full screen slide show
  • Able to browse through search results as if they were an album
  • Skinned user interface – ships with dark and light skins
  • Rate media objects on a 5-star scale
  • Flexible sorting
  • Adaptive rendering for mobile devices and tablets

Under the hood, there are significant changes as well:

  • New data provider model eliminates database-specific code and makes data upgrades significantly easier (EF Code First with Data Migrations)
  • Removed ComponentArt dependency and replaced with jQuery widgets
  • Removed dependence on MS Ajax library and ScriptManager
  • Replaced ASMX web services with Web.API
  • Simplified solution architecture to reduce number of projects from 11 to 6.
  • JavaScript follows modern patterns such as the Revealing Prototype Pattern and Revealing Module Pattern, with no variables exposed to the global scope.

Over the next few weeks I will explore these features in additional blog posts, but you’ll find some good stuff in the posts where I announced the Public Preview of Gallery Server Pro 3.0 and the announcement of GSP 3.0.

Requirements

Version 3 requires .NET 4.5 and ASP.NET on the server. This is a change from 2.6, which required .NET 4.0. By default it uses an internal SQL CE database, but you’ll get faster performance with SQL Server 2005 or higher, including the free Express versions.

Clients need only a web browser, with no dependencies on any plug-ins except where necessary to play certain media files (for example, playing MP4 on Chrome and Firefox requires Flash). Current versions of all major browsers have been tested and work well.

Installation

NOTE: This is pre-release software and does not include support for upgrading earlier versions of GSP, nor is there any guarantee you will be able to migrate to the release version. The final version will, however, support upgrading from 2.6.

Installation is improved from previous versions, which used an install wizard to guide you through database creation and admin account setup. I simplified it to the point where no install wizard was needed. Follow these steps:

  1. Extract the zip file to a directory. Configure the directory to run as an application in IIS under .NET 4.5. Make sure the IIS process identity has modify permissions to the App_Data and gs\mediaobjects directory.
  2. SQL Server only: To use SQL Server, open web.config and comment out the SQL CE connection string named GalleryDb. Add a connection string for your SQL Server – you can uncomment the sample SQL Server connection string in the file. Be sure it is named GalleryDb. If the specified database does not exist, the gallery will attempt to create it when the app starts.
  3. Open default.aspx in a web browser. The database will automatically be configured and seeded with default data. This step may take a minute or two, so be patient. The screen will look like this:

    gsp_v3_inst1
  4. Click the link to create an admin account. Enter a username and password and you are all set!

gsp_v3_inst2

gsp_v3_inst3

Running from Source Code

You can open the source code in Visual Studio 2012, including the free Visual Studio Express 2012 for Web. You should be able to compile and run the gallery without any additional dependencies.

Known Issues & Removed Features

These are the known issues:

  • Album treeview and splitter panes do not work in IE 8 and earlier
  • The light skin is not finished. In fact, it is exactly like the dark skin with only the page background color changed. This is a good opportunity for a volunteer to jump in – all you need to do is edit the colors in gallery.css and pick new icons for the gs\skins\light\images folder.
  • No support for upgrading from earlier versions
  • The backup/restore feature is not functional.
  • Concurrency error sometimes occurs when multiple users request an album at the same time

The following features existed in 2.6 but were removed in 3.0:

  • The start and end dates for albums no longer exist in the UI. These tended to cause confusion and were not used by many people. However, the API still supports them so it is possible to modify the UI template to add them back.
  • There are a couple places on the gallery settings and user settings pages where all user accounts were displayed in a drop down. Those dropdowns now include only those users who are site or gallery admins.
  • Cannot re-extract metadata during a sync. This feature has been replaced by the metadata rebuilding options in the site admin metadata page.

Final Release & Reporting Issues

I hope to release the final version within a couple months. It will be driven by the time it takes to put the last few things in place (that is, implementing an upgrade algorithm and fixing the issues).

Please report any issues on the beta forum or e-mail me at roger *at* techinfosystems *dot* com. Remember that I can only fix problems that I know about.

New License Option & DotNetNuke Version

I expect to continue providing a free GPL version of GSP, just like now. But I have heard from many of you that you would like a commercial license option, so I am looking into making that possible. A commercial license will free you of the GPL restrictions, such as having to publicly provide the source code for any changes you make. In addition, I may offer guaranteed support options.

Adding a commercial license option will help me continue to be able to focus on improving GSP instead of taking on paying contracts that distract me from this project. I cannot stress enough how important your donations are to keeping this project alive. I thank you for your support and humbly request that you provide a contribution to the best of your ability.

Once the final release is out, I will focus on merging the code with the DotNetNuke branch of GSP. Due to the substantial modifications, this will likely take several weeks and be pretty difficult. But I am committed to making it happen.

Gallery Server Pro Binary Pack Updated

The Gallery Server Pro Binary Pack is a set of open source utilities that add some great features to your gallery:

  • Video and audio encoding to web-optimized formats
  • Thumbnail extraction for video and TXT, PDF, EPS, and PSD (Photoshop) files
  • Metadata extraction for video and audio formats

These components are GhostScript, ImageMagick, and FFmpeg. Today I gathered the latest versions of them and packaged them together into an updated Gallery Server Pro Binary Pack.

Download the Gallery Server Pro Binary Pack.

Progressive loading for MP4

By far the most exciting new feature in this update is FFmpeg’s new support for creating an MP4 that will play in a browser as soon as a few seconds are buffered rather than waiting for the entire video to download. The benefit of this is that now GSP can create standard-compliant MP4 videos that start playing immediately. Because previous versions of FFmpeg forced the browser to download the entire video before beginning playback, GSP defaulted to creating a Flash Video (.flv), which *did* start playing immediately. But that created its own headaches, as the number of devices unable to run Flash have greatly increased over the last couple years.

The next version of GSP will default to creating H.264 MP4 video from most uploaded videos. But you don’t have to wait for 3.0. Install this binary pack into any 2.4 or later version of GSP and then update the Video & Audio page in site admin to include this FFmpeg argument string for MP4 video conversions:

-y -i "{SourceFilePath}" -b 384k -vcodec libx264 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8 -subq 6 -trellis 0 -refs 5 -bf 0 -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -ac 1 -ar 16000 -r 13 -ab 32000 -movflags +faststart "{DestinationFilePath}"

You will also want to swap the positions of the MP4 and FLV rows so that FLV is *below* MP4, thus giving it a lower priority. The above string is close to what I expect to ship in v3. It has been carefully optimized to create a web-friendly H.264 MP4 video that works well on bandwidth-sensitive mobile devices as well as traditional computers. When you are done it will look like this:

3-14-2013 3-07-47 PM

With this change, all uploaded videos will be converted to MP4 as well as ones you sync when the ‘overwrite optimized’ option is enabled.

Remember that the Binary Pack requires full trust environments. You can tell if your site is running in full trust by looking it up on the Site Settings – General page.

Tuesday, March 5, 2013

Got a Windows tablet?

Update March 11, 2013: I was able to see a Surface for myself at Best Buy a couple days ago and discovered an issue. The album treeview was appearing at the top of the page with the rest of the content below it. This morning I updated the code again, but I still need someone to confirm that it’s fixed. Thanks!

Cut to the chase: I’m looking for someone with a Microsoft tablet (like a Surface) to look at the beta site and tell me whether you see a 3-pane layout like the first screenshot or a single pane like the second. Reply in the comments or send me an e-mail (roger *at* techinfosystems *dot* com). Read on for the full story.

Last week I found myself at a Microsoft store in Minneapolis with the family, so I took the opportunity to see how the beta site looked on a Surface. (Side note: I really should call it a CTP site, since the beta hasn’t yet been released. It’s very close, though.) The styling looked right, the MP4 videos played using the native HTML5 video tag, and the action was smooth and responsive. All great. But there was one problem. I couldn’t use my finger to grab the splitter bars to resize the left and right panes.

gsp_beta_panes

(This screenshot is from my desktop PC, not the Surface, but it looked the same.)

This is actually a problem with every touchscreen device I’ve tried, from Android to iOS to Windows Phone. The splitter is a jQuery plug-in, and it was designed to handle mouse clicks for resizing, not touch events. I’ve looked at the source and tried to make it touch-capable, but haven’t been successful. So, in an effort to stay on track with the release, I made the decision a while back to use javascript to detect a touchscreen and *not* use the splitter on those devices.

Instead of a three-pane view, touchscreen devices show the center pane full screen with the contents of the right pane appearing below the center content. For example, here is how an album looks on a touchscreen that is about 500 pixels wide:

gsp_beta_panes2

That turns out to be pretty much the ideal behavior you would want on small touchscreens, since they don’t have sufficient width to justify panes anyway. But larger 10-inch tablets could benefit from the pane layout so the ultimate goal is still to make the splitter bar touch-capable so I can re-enable it on large tablets. But this will probably be after the v3 release.

Getting back to the Surface, I noticed that it was displaying the 3-pane layout just like a desktop browser. Something was wrong with my touchscreen detection javascript. After a little googling with bing, I learned it is very difficult to reliably detect a touch device. I had assumed that using Modernizr.touch would be fine, but IE10 returns false, even when run on a tablet.

After digging around, I found a different technique that supposedly works on MS tablets:

var isTouchScreen = !!('ontouchstart' in window) || !!navigator.msMaxTouchPoints;


I updated the beta site to use this code and confirmed it works as expected on the devices I have laying around, but I don’t have a MS tablet to test it on. So I ask you, Dear Reader, if you have a Microsoft tablet like a Surface, can you go to the beta site and tell me whether you see a 3-pane layout like the first screenshot or a single pane like the second. Thanks!