Gallery Server Blog

27 Jan, 2016

Troubleshooting SQL Server “The wait operation timed out”

By |January 27th, 2016|Troubleshooting|0 Comments

Today I helped a customer troubleshoot a SQL Server timeout error in their gallery. It took quite a while to get to the root cause, but once we found it, the fix was ridiculously simple. I'm sharing it here in case it helps others with the issue, since it's related to SQL Server and is not really a Gallery Server issue. This is the error they kept getting: Error: An error occurred while executing the command definition. See the inner exception for details. Event Summary Url http://[redacted]/default.aspx?aid=14 Timestamp 1/27/2016 6:13:54 PM Exception Type System.Data.Entity.Core.EntityCommandExecutionException Message An error occurred while executing the command definition. See the inner exception for details. Source EntityFramework Target Site System.Data.Common.DbDataReader ExecuteStoreCommands(System.Data.Entity.Core.EntityClient.EntityCommand, System.Data.CommandBehavior) at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues) at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) at System.Data.Entity.Core.Objects.ObjectQuery1.<>c__DisplayClass7.<GetResults>b__5() at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func1 operation) at System.Data.Entity.Core.Objects.ObjectQuery1.GetResults(Nullable1 forMergeOption) at System.Data.Entity.Core.Objects.ObjectQuery1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0() at System.Data.Entity.Internal.LazyEnumerator1.MoveNext() at GalleryServerPro.Business.Factory.AddChildObjects(IAlbum album) at [...]

20 Jan, 2016

Demystifying the video encoder FFmpeg arguments

By |January 20th, 2016|Tips & Tricks|0 Comments

The Gallery Server Binary Pack includes FFmpeg, the popular open source utility that provides powerful video and audio capabilities. Gallery Server uses it to rotate videos, create web-optimized versions of your original audio and video files, and generate thumbnails from a video. Haven't installed it yet? It's free, so get it now (expand the 'more downloads' section to see it). Let's say you have a bunch of WMV videos you want to share with the world. Browsers must have a supporting plugin such as Silverlight in order for them to play in the browser, and an increasing number of operating systems and browsers don't support plugins (iOS, Android, Microsoft Edge). It would be better if these videos were converted to H.264 MP4, which is natively supported by most modern browsers and operating systems, including iOS and Android. That's exactly what Gallery Server does when you upload a video - it preserves the original and [...]

13 Nov, 2015

Get faster page loading with on-demand thumbnail image retrieval

By |November 13th, 2015|Tips & Tricks|2 Comments

We recently had a customer concerned about performance when viewing certain albums in their gallery. After investigation, we saw that these albums had a large number of media assets. In one case there were 4,120 images. Since each thumbnail image required an HTTP call to the server, that album had at least 4,120 calls to the server before the page was fully loaded. In Chrome that took about 20 seconds. In Microsoft Edge it was dramatically better, about 5 seconds. But in either case that's too much time. Our best practice advice is to try to keep fewer than 500 or 1000 items in each album, but this customer had business requirements that made splitting up the album impossible. They turned on the paging feature, which helped speed up the screen rendering but under the hood those 4,120 HTTP calls were still getting made, triggering the spinning circle icon we've all seen that tells [...]

19 Oct, 2015

Native support for Nikon NEF and Canon CR2 RAW files

By |October 19th, 2015|Uncategorized|0 Comments

Recently a potential customer was kicking the tires of Gallery Server and noticed they weren't getting thumbnail or web-optimized images from the raw NEF photos taken by their Nikon cameras. In fact, they couldn't even add a NEF file to the gallery unless they selected the 'allow all file types' option on the Media Object Types page. They asked if this could be improved, so we dug into it and found there were actually two different ways to get great NEF support, including image generation, with just a bit of configuration. We believe the first technique will work for other file types, too, such as Canon CR2 and other RAW file formats. At the end we touch on this and describe where we're headed.   FIRST - Add the NEF mime type Regardless of the method you choose, the first thing you need to do is tell Gallery Server that files with the [...]

26 Aug, 2015

Experiments with SQLite

By |August 26th, 2015|Dev Insight|0 Comments

Long time fans of Gallery Server may recall that versions earlier than 2.5 supported SQLite as a database option. At the time it was a great choice because it was a file-based database that was robust, fast, required no extra software on the server, and required no maintenance. The only real downsides were that we had to distribute both a 32-bit and 64-bit version, and it ran only in Full Trust environments (no worky on GoDaddy). When Microsoft released SQL CE 4, we realized it would solve both of these issues, so in 2.5 we dropped SQLite support and moved to SQL CE. Overall it's been a great move - it just "works" and people who use it almost never have to interact with the underlying database. But it came with a price. It is slow. So slow that customers who use SQL Server often see a 20-fold increase in database performance.  If you're running [...]

25 Aug, 2015

Automatically upload camera pics & video to your gallery

By |August 25th, 2015|Tips & Tricks|0 Comments

Say you have people taking photos and videos you want to get into your gallery. Maybe they're field workers snapping pics of a job site. Maybe they're church members having fun at the summer picnic. Maybe it's you taking vacation photos with your lovely family. There's a good chance you're using a mobile phone. What's the best way to get those photos and videos into your gallery? Well, you have options: Use the browser in your phone to go to your gallery and manually upload the files using the 'Add objects' command in Gallery Server. Email the media files to yourself and then upload them to the gallery from a desktop computer. Plug your phone into your PC with a cable, copy the files over, and upload them to the gallery. Frankly, I'm not a big fan of any of these methods. It feels clunky and like too much work. For my personal gallery, I [...]

6 Jul, 2015

Use Gmail as your SMTP Server – even when using 2-factor authentication (2-step verification)

By |July 6th, 2015|Tips & Tricks|0 Comments

Gallery Server can send emails for various events such as errors, account signup verification, and admin notification of new accounts. To configure, you must give Gallery Server an SMTP server it can use for sending the e-mails. Many organizations have an internal SMTP server you can use and hosting companies often provide one as well. But if you are self-hosting or can't use the available SMTP server for whatever reason, Gmail provides one you can use to send up to 2,000 messages a day. This post tells you how to set up Gmail as an SMTP server for your gallery, including how to set things up when your Google account is configured with 2-factor authentication. Set up Gmail as your SMTP server Of course first you need a Google account. Get one here. Now open web.config for your gallery and find the system.net section. The file will be in the root of your [...]

8 May, 2015

Get up and running with Active Directory integration

By |May 8th, 2015|Uncategorized|2 Comments

Out of the box Gallery Server uses a self-contained set of user accounts, exposing functionality for adding, editing, and removing them in a set of admin pages. This works great when you want to keep them separate or your gallery is primarily used by anonymous users. But in many cases you want to integrate with an existing set of users, whether they're in a home-grown user table, a 3rd party membership system, or Active Directory. All these scenarios are possible because Gallery Server uses the provider model for storing users and roles. Just drop in a DLL containing a membership-compatible class in the bin directory, update web.config to point to it, and you're all set. In this post we'll focus on configuring a gallery to use Active Directory for membership. For other scenarios, check out the Membership Configuration section in the Administrator's Guide. If you're not familiar with the ASP.NET Membership Provider model, [...]

4 Mar, 2015

Reduce your gallery’s drive space requirements up to 99%

By |March 4th, 2015|Tips & Tricks|0 Comments

When you add a media asset to your gallery, Gallery Server creates a thumbnail and web-optimized file that is used for most gallery activities. For example, clicking the thumbnail image in an album shows the web-optimized version, not the original. By default, web-optimized images are about 640 px on the longest side and - for JPG images - created with a compression quality setting of 70 (you can change this on the Media Objects - Images page). A typical web-optimized image is about 30-70 KB regardless of the size of the original image. It is common for today's digital cameras to produce files that are 8MB and even higher. That's huge, so it's highly beneficial to use the smaller file whenever possible. It downloads and renders quickly and uses far less bandwidth and server resources than the original would have. The original still exists on the server and can be downloaded through [...]

26 Feb, 2015

Support forum is live

By |February 26th, 2015|Announcements|0 Comments

The title is a bit misleading because the forum has actually been live for a couple weeks, but I'm finally getting around to writing about it. This was phase two of our overhaul of galleryserverpro.com. Phase 1 was going from a hand-built ASP.NET site to one based on WordPress. I was hesitant to get out of my comfort zone since WordPress is written in PHP, about which I knew little or nothing. But it would have been a massive effort to hand build a new site while trying to get all the bits and pieces right, like SEO, responsive design, accessibility, etc. Turns out it was a good move, as WordPress - and especially its vast ecosystem of plugins - gave me just about everything I wanted and then some. I bought a professional-looking theme and was able to put together a modern, responsive site that is already showing vast improvements in SEO. For [...]