Gallery
The Gallery page manages photo collections used for screensavers, digital photo frames, and background images in GEM user interfaces. Gallery photos can be displayed when UIs are idle or as decorative backgrounds.
Overview
Gallery features include:
- Photo Upload: Upload multiple images at once
- UI-Specific Galleries: Different photo collections per UI
- Path Configuration: Specify local or network photo directories
- Batch Management: Select and delete multiple photos
- Preview: Full-screen photo preview
- Screensaver Integration: Automatic slideshow on idle timeout
Interface Layout
The Gallery page includes:
Header Section:
- UI selector
- Gallery path configuration
- Screen timeout action configuration
Toolbar:
- Upload controls
- Selection controls
- Delete button
- Status indicators
Gallery Grid:
- Thumbnail display of all photos
- Checkbox selection
- Click to preview
Configuration
UI Selector
Select which UI to manage gallery for:
- Each UI can have its own gallery path
- Photos are UI-specific
- Change UI to manage different galleries
Example:
Kitchen Panel: Family photos
Living Room Panel: Vacation photos
Guest Room Panel: Landscape photos
Gallery Path
Path to directory containing gallery photos:
Path Input:
- Enter full path to photo directory
- Can be local or network path
- Must be accessible to GEM server
Save Button:
- Click to save path for selected UI
- Path stored as UI attribute:
gallery_photo_path
Examples:
Local Directory:
/home/gem/photos/family
/mnt/photos/vacation
/opt/gem/gallery
Network Share:
/mnt/nas/photos/living_room
/media/photos/screensaver
Requirements:
- Directory must exist
- GEM must have read permissions
- Supported image formats: JPG, PNG
Screen Timeout Action
Configure what happens when UI is idle:
Options:
- not_set - No action on timeout
- gallery - Show photo gallery slideshow
- blackout - Turn off the screen
- none - Keep the current page displayed
How It Works:
- User idle for configured timeout period (set in UI attributes:
screen_timeout) - Selected action executes automatically
- Gallery action:
- Starts photo slideshow
- Shows photos from gallery path
- Cycles through photos at configured interval
- Touch/click to exit back to normal UI
Save Button:
- Click to save timeout action for selected UI
Uploading Photos
Upload Interface
File Input:
- Supports multiple file selection
- Hold Ctrl/Cmd to select multiple files
- Or drag-and-drop (if supported by browser)
Upload Button:
- Click to upload selected files
- Progress indicator shows upload status
- Success/error messages for each file
Upload Process
- Select UI to upload to
- Verify Gallery Path is set
- Click file input or drag files
- Select photos (JPG or PNG)
- Click Upload button
- Photos upload to configured gallery path
- Gallery refreshes showing new photos
Supported Formats:
- JPEG (.jpg, .jpeg)
- PNG (.png)
File Size Recommendations:
- Max: 5MB per photo
- Recommended: 1-2MB (good quality, reasonable size)
- For large displays: 1920x1080 or higher resolution
- For tablets: 1280x720 adequate
Batch Upload
Upload multiple photos at once:
- Select 10, 20, or 100+ photos
- Click Upload
- All photos upload sequentially
- Success message shows count uploaded
Managing Photos
Viewing Gallery
Photos display in a responsive grid:
- Thumbnails show image preview
- Checkbox in top-left corner
- Click thumbnail to full-screen preview
- Hover effects indicate interactivity
Selecting Photos
Individual Selection:
- Click checkbox on each photo
- Selected photos highlighted
Select All:
- Click Select All button
- All photos selected
Deselect All:
- Click Deselect All button
- All selections cleared
Selection Count:
- Toolbar shows count: "X selected"
Previewing Photos
Click any photo thumbnail to:
- Open full-screen preview
- View photo at full resolution
- Click anywhere to close preview
Deleting Photos
- Select photos with checkboxes
- Click Delete Selected button
- Confirm deletion
- Selected photos permanently deleted from gallery path
Warning: Deletion is permanent. Consider backing up photos before deleting.
Gallery Slideshow
When screen timeout action is set to "gallery":
Slideshow Behavior
Activation:
- User idle for timeout period (e.g., 5 minutes)
- Gallery slideshow starts automatically
Display:
- Photos shown full-screen
- Transitions between photos (fade, slide, etc.)
- Photo changes every 5-15 seconds (configurable)
- Random or sequential order
Controls:
- Touch/click anywhere to exit
- Returns to previous UI page
- Resets idle timeout
Configuration
Set in UI attributes:
// Timeout before screensaver starts
screen_timeout: 300 // 5 minutes in seconds
// What to do on timeout
screen_timeout_action: "gallery"
// Gallery slideshow settings
gallery_interval: 10 // Seconds per photo
gallery_transition: "fade" // Transition effect
gallery_shuffle: true // Random order
Common Workflows
Setting Up Screensaver
For a wall-mounted tablet:
- Select UI: Wall Panel
- Set Gallery Path:
/mnt/photos/family - Click Save next to gallery path
- Set Screen Timeout Action: gallery
- Click Save next to timeout action
- Upload photos to gallery
- Configure timeout in UI attributes:
screen_timeout: 180(3 minutes)
Result: After 3 minutes of inactivity, family photos display as slideshow.
Creating Digital Photo Frame
For dedicated photo frame display:
- Create UI:
photo_frame - Set minimal navigation (or none)
- Set gallery path to photo collection
- Upload photos
- Set screen timeout to very short (30-60 seconds)
- Set timeout action to gallery
- Set timeout action to gallery
- Assign to dedicated tablet/display
Result: Display shows photos almost constantly, with brief UI access if touched.
Multiple Gallery Collections
For different rooms with different photo sets:
Living Room:
UI: living_room_panel
Gallery Path: /mnt/photos/family
Guest Room:
UI: guest_room_panel
Gallery Path: /mnt/photos/landscapes
Master Bedroom:
UI: master_bedroom_panel
Gallery Path: /mnt/photos/memories
Each room shows appropriate photo collection.
Seasonal Gallery Updates
-
Create seasonal photo directories:
/mnt/photos/spring/mnt/photos/summer/mnt/photos/fall/mnt/photos/winter -
Update gallery path seasonally:
- March:
/mnt/photos/spring - June:
/mnt/photos/summer - September:
/mnt/photos/fall - December:
/mnt/photos/winter
- March:
-
Or create macro to switch paths automatically
Photo Sources
Local Storage
Photos stored on GEM server:
Advantages:
- Fast loading
- No network dependency
- Full control
Disadvantages:
- Limited by server disk space
- Manual upload required
Setup:
- Create directory on server
- Upload photos via Gallery page
- Or copy photos directly to server filesystem
Network Storage (NAS)
Photos stored on network-attached storage:
Advantages:
- Large capacity
- Centralized storage
- Easy management from computer
- Can update photos without accessing GEM
Disadvantages:
- Network dependency
- Slower than local
- Requires NAS configuration
Setup:
-
Mount NAS share on GEM server:
sudo mkdir /mnt/nas_photossudo mount -t cifs //nas.local/photos /mnt/nas_photos -o username=user,password=pass -
Set gallery path:
/mnt/nas_photos/family -
Photos load from NAS
Cloud Storage
Photos from cloud services (Google Photos, Dropbox, etc.):
Options:
- Sync to Local: Use rclone or similar to sync cloud photos to local directory
- Direct Access: Use API to fetch photos (requires custom widget)
Photo Organization
Directory Structure
Organize photos with subdirectories:
/mnt/photos/
├── family/
│ ├── 2023/
│ ├── 2024/
│ └── favorites/
├── vacation/
│ ├── beach/
│ ├── mountains/
│ └── europe/
└── seasonal/
├── spring/
├── summer/
├── fall/
└── winter/
Point gallery path to any subdirectory for curated collections.
Naming Conventions
Use descriptive filenames:
2024-01-15_family_dinner.jpg
vacation_beach_sunset.jpg
spring_garden_tulips.jpg
Benefits:
- Easy to identify in gallery
- Chronological sorting if dated
- Searchable names
Performance Considerations
Photo Optimization
Before uploading:
-
Resize: Match display resolution
- 1920x1080 for full HD displays
- 1280x720 for tablets
- Smaller for mobile
-
Compress: Reduce file size without quality loss
- Use tools like ImageOptim, TinyPNG
- Target: 500KB - 2MB per photo
-
Format: Choose appropriate format
- JPEG for photos
- PNG for images with transparency
Gallery Size
Recommendations:
- Small Gallery: 20-50 photos
- Medium Gallery: 50-200 photos
- Large Gallery: 200-1000 photos
Performance Impact:
- Loading time increases with gallery size
- Memory usage for thumbnail generation
- Consider multiple smaller galleries instead of one huge gallery
Caching
GEM caches photo thumbnails for fast display:
- First load generates thumbnails
- Subsequent loads use cached versions
- Cache refreshes when photos change
Slideshow Customization
Configure slideshow behavior via UI attributes:
Timing
gallery_interval: 10 // Seconds per photo (default: 10)
Recommendations:
- Fast slideshow: 5 seconds
- Normal: 10-15 seconds
- Slow/relaxed: 20-30 seconds
Transition Effects
gallery_transition: "fade" // or "slide", "none"
Options:
fade- Crossfade between photosslide- Slide left/rightnone- Instant change
Display Order
gallery_shuffle: true // Random order (default: false = sequential)
Random: Different order each slideshow Sequential: Alphabetical by filename
Additional Options
gallery_show_filename: true // Show filename overlay
gallery_show_exif: true // Show photo date/time from EXIF
gallery_fit: "contain" // or "cover" - how photo fits screen
Advanced Topics
External Photo APIs
Integrate with external photo services:
Google Photos:
- Create widget that fetches from Google Photos API
- Authenticate with API key
- Fetch photos from shared album
- Display in widget
Flickr, Instagram, etc.:
- Similar approach with respective APIs
- Store API keys in secure attributes
- Refresh periodically
Dynamic Galleries
Change gallery content based on:
Time of Day:
- Morning: Bright, energetic photos
- Evening: Calm, relaxing photos
- Night: Dark, low-light photos
Season:
- Spring: Flowers, gardens
- Summer: Beach, outdoor
- Fall: Foliage, harvest
- Winter: Snow, holidays
Events:
- Holidays: Holiday-themed photos
- Birthdays: Birthday photos
- Anniversaries: Special occasion photos
Implement with macros or scheduled tasks that update gallery_photo_path.
Gallery Widgets
Create custom widgets to display gallery photos:
<script>
import {onMount} from 'svelte';
let photos = [];
let currentIndex = 0;
onMount(async () => {
photos = await GemApp.getInstance().getGalleryPhotos();
// Rotate every 10 seconds
setInterval(() => {
currentIndex = (currentIndex + 1) % photos.length;
}, 10000);
});
</script>
{#if photos.length}
<img src={photos[currentIndex]} alt="Gallery" />
{/if}
Photo Metadata
Store metadata in filenames or EXIF:
Filename Metadata:
2024-01-15_location-hawaii_category-vacation.jpg
EXIF Metadata:
- Date taken
- Camera model
- GPS coordinates
- Tags/keywords
Widget can parse and use metadata for:
- Filtering by category
- Sorting by date
- Grouping by location
- Displaying captions
Troubleshooting
Gallery Not Loading
Check:
- Path Exists: Verify directory exists on server
- Permissions: GEM has read permissions on directory
- Photos Exist: Directory contains photos
- Format: Files are JPG or PNG
- UI Selected: Correct UI selected
Photos Not Uploading
Check:
- Path Set: Gallery path must be configured first
- Path Writable: GEM has write permissions
- Disk Space: Server has sufficient free space
- File Size: Individual files under size limit
- Format: Only JPG and PNG supported
Slideshow Not Starting
Check:
- Timeout Action: Set to "gallery" (not "not_set")
- Timeout Value:
screen_timeoutattribute set - Photos Available: Gallery has photos
- Path Valid: Gallery path points to valid directory
- UI Idle: User actually idle for timeout period
Poor Slideshow Performance
Causes:
- Photos too large (file size or resolution)
- Too many photos loading at once
- Network latency (if using network storage)
Solutions:
- Resize photos to display resolution
- Compress photos to reduce file size
- Use local storage instead of network
- Reduce gallery size
Cannot Delete Photos
Check:
- Permissions: GEM has write permissions on gallery directory
- File Locks: Photos not open in another application
- Network: Network path accessible
Wrong Photos Showing
Check:
- UI Selected: Viewing correct UI's gallery
- Path: Gallery path points to correct directory
- Cache: Clear browser cache
- Refresh: Reload gallery list
Best Practices
Photo Selection
-
Quality: Use high-quality photos appropriate for display size
-
Orientation: Mix of landscape and portrait, or match display orientation
-
Content: Choose appropriate content for location
- Public areas: Generic, safe-for-work
- Private areas: Personal, family photos
-
Quantity: 20-100 photos prevents repetition without being overwhelming
-
Curation: Remove blurry, duplicate, or poor-quality photos
Directory Management
-
Dedicated Directory: Don't share with other applications
-
Backup: Back up photos separately from GEM
-
Organization: Use subdirectories for categories
-
Naming: Use consistent, descriptive filenames
-
Permissions: Set appropriate read/write permissions
Performance
-
Optimize Photos: Resize to display resolution before upload
-
Compress: Use 80-90% JPEG quality
-
Limit Size: Keep gallery under 500 photos
-
Local Storage: Prefer local over network for performance
-
Preload: System preloads next photo for smooth transitions
Use Cases
Family Photo Frame
Wall-mounted tablet displaying family photos:
UI: family_room_panel
Gallery Path: /mnt/nas/photos/family
Screen Timeout: 60 seconds
Timeout Action: gallery
Gallery Interval: 15 seconds
Gallery Shuffle: true
Result: Shows family photos continuously, with 60-second access to controls if touched.
Lobby Display
Commercial lobby showing company photos:
UI: lobby_display
Gallery Path: /opt/gem/gallery/company
Screen Timeout: 30 seconds
Timeout Action: gallery
Gallery Interval: 20 seconds
Show Filename: false
Upload photos of:
- Company milestones
- Team photos
- Product images
- Office locations
Vacation Rental
Different photo sets per rental unit:
Unit 1:
UI: unit_1_panel
Gallery Path: /mnt/photos/unit_1
Photos: Beach, sunset, property exterior
Unit 2:
UI: unit_2_panel
Gallery Path: /mnt/photos/unit_2
Photos: Mountain, hiking, property views
Each unit shows location-appropriate imagery.
Integration with Other Features
Theme Backgrounds
Use gallery photos as theme backgrounds:
- Upload photo to gallery
- Photo appears in file system
- Reference in theme background mapping
- Background changes based on page/route
Widget Backgrounds
Custom widgets can use gallery photos:
<script>
let photos = await GemApp.getInstance().getGalleryPhotos();
let randomPhoto = photos[Math.floor(Math.random() * photos.length)];
</script>
<div style="background-image: url({randomPhoto})">
<!-- Widget content over photo background -->
</div>
Event-Triggered Galleries
Change gallery path based on events:
Example: Holiday photos during December
// In macro or trigger
if (currentMonth === 12) {
await GemApp.getInstance().setAttribute('ui', uiId, 'gallery_photo_path', '/mnt/photos/holidays');
}
Advanced Topics
Automated Photo Sync
Sync photos from cloud storage automatically:
Using rclone:
# Cron job to sync Google Photos to local gallery
0 2 * * * rclone sync googlephotos:album/Family /mnt/photos/family
Using rsync:
# Sync from another server
0 3 * * * rsync -av user@nas:/photos/ /mnt/photos/
Photo Rotation
Automatically rotate through different galleries:
Monthly Rotation:
- Create galleries for each month
- Macro runs on 1st of each month
- Updates gallery_photo_path attribute
- New photos displayed
Event-Based:
- Birthdays: Show birthday photos
- Anniversaries: Show anniversary photos
- Seasons: Show seasonal photos
Metadata Display
Show photo information in slideshow:
Configure via attributes:
gallery_show_filename: true
gallery_show_date: true
gallery_show_location: true // From EXIF GPS
Requires custom slideshow component or theme JavaScript.
Related Documentation
- UIs - Configuring UI timeout behavior
- UI Themes - Using photos as backgrounds
- UI Pages - Adding gallery widgets to pages
- Attributes - Gallery configuration attributes