All Projects → alberto093 → ImageUI

alberto093 / ImageUI

Licence: MIT license
A photo browser inspired by Apple Photos app

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to ImageUI

Hoverzoom
Google Chrome extension for zooming images on mouse hover
Stars: ✭ 426 (+868.18%)
Mutual labels:  photos, images
React Grid Gallery
Justified image gallery component for React
Stars: ✭ 571 (+1197.73%)
Mutual labels:  photos, images
Imagestore
Open source google photos alternative!
Stars: ✭ 429 (+875%)
Mutual labels:  photos, images
Bubblepictures
Bubble Pictures for iOS done in Swift
Stars: ✭ 434 (+886.36%)
Mutual labels:  photos, images
Unsplash Js
🤖 A server-side JavaScript wrapper for the Unsplash API
Stars: ✭ 1,647 (+3643.18%)
Mutual labels:  photos, images
Unsplash Php
👻 Official PHP wrapper for the Unsplash API
Stars: ✭ 332 (+654.55%)
Mutual labels:  photos, images
Nanogallery2
a modern photo / video gallery and lightbox [JS library]
Stars: ✭ 488 (+1009.09%)
Mutual labels:  photos, images
hes-gallery
Light, dependency free, responsive gallery script
Stars: ✭ 27 (-38.64%)
Mutual labels:  photos, images
Photo view
📸 Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget. Photo View is largely used to show interacive images and other stuff such as SVG.
Stars: ✭ 1,280 (+2809.09%)
Mutual labels:  photos, images
Photobrowser.forms
Full screen image viewer(Xamarin.Forms) that includes "pinch to zoom" and "swipe to dismiss" gestures.
Stars: ✭ 75 (+70.45%)
Mutual labels:  photos, images
Photo Affix
📷 Stitch your photos together vertically or horizontally easily!
Stars: ✭ 969 (+2102.27%)
Mutual labels:  photos, images
Exiftool Vendored.js
Fast, cross-platform Node.js access to ExifTool
Stars: ✭ 200 (+354.55%)
Mutual labels:  photos, images
Datasets
🎁 3,000,000+ Unsplash images made available for research and machine learning
Stars: ✭ 1,805 (+4002.27%)
Mutual labels:  photos, images
Unsplash rb
💎 Ruby wrapper for the Unsplash API.
Stars: ✭ 202 (+359.09%)
Mutual labels:  photos, images
hermitage
Service that provides storage, delivery and modification of your images
Stars: ✭ 33 (-25%)
Mutual labels:  images
imgs-upload-srv
【Released】🌁一款以图片管理为核心的图床。在众多上传的图片中管理自己的图片,分类它们,贴上标签...以便以后精确管理。提供简单分享&在线外链("仅存储"&UI2.x功能正在进行中)。🌹
Stars: ✭ 73 (+65.91%)
Mutual labels:  images
PhotosExporter
Command line program to export and backup your macOS Photos Library
Stars: ✭ 133 (+202.27%)
Mutual labels:  photos
wallup-android
Hand curated Images & 'Auto Wallpaper'
Stars: ✭ 30 (-31.82%)
Mutual labels:  images
wp-term-images
Images for categories, tags, and other taxonomy terms
Stars: ✭ 34 (-22.73%)
Mutual labels:  images
react-simple-image-viewer
Simple image viewer component for React
Stars: ✭ 44 (+0%)
Mutual labels:  images

ImageUI

Platform

Welcome to ImageUI!

ImageUI is an open source project for displaying images and videos (not yet implemented) in a similar way to Apple’s Photos app. If you'd like to contribute to ImageUI see Contributing. In this version there is the photo browser that allows to display thumbnail and full-size images.

Features

  • Loading remote, local and in-memory images
  • Support both portrait and landscape mode
  • Sharing, deleting and custom actions
  • Size class adaptive layout (iOS, iPadOS)
  • Dark mode
  • Multiple gestures (tap, double tap, pan, swipe, pinch)
  • LPLinkMetadata (iOS 13.0+)
  • SwiftUI compatible

Requirements

  • iOS 11.0+
  • Xcode 11+
  • Swift 5.1+

Dependencies

Powerful Image Loading System

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate ImageUI into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'ImageUI'

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate ImageUI into your Xcode project using Carthage, specify it in your Cartfile:

github "alberto093/ImageUI"

Swift Package Manager

Swift Package Manager is a dependency manager built into Xcode.

If you are using Xcode 11 or higher, go to File / Swift Packages / Add Package Dependency... and enter package repository URL https://github.com/alberto093/ImageUI.git, then follow the instructions. Once you have your Swift package set up, adding ImageUI as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/alberto093/ImageUI.git")
]

Usage

Creating the data source

IFImage is the data structure that represents the image metadata. You can instantiate an IFImage in a three different ways:

let urlImage = IFImage(url: imageURL) // network URL
let fileImage = IFImage(path: filePath) // file URL (path)
let memoryImage = IFImage(image: myUIImage) // in-memory image

To get the best performances you should provide both the thumbnail and full-size images especially if you are using network URLs. Optionally you can provide a title that represents the navigation bar title (and the sharing metadata title available on iOS 13.0+) and a loading placeholder image.

let image = IFImage(
    title: "First image",
    original: .remote(url: imageURL),
    thumbnail: .remote(url: thumbnailURL),
    placeholder: loadingImage)

Ideally the thumbnail images' sizes should be smaller than 300x300 (the maximum size on iPad)

Displaying the browser

IFBrowserViewController represents the container of both thumbnails and full-size images. It is possibile to use it directly in Storyboard or programmatically and It does not require a UINavigationController but It is strongly recommended.

let viewController = IFBrowserViewController(images: images, initialImageIndex: 0)
viewController.configuration.actions = [.share, .delete]

// Navigation controller
navigationController.pushViewController(viewController, animated: true)

// Modal presentation
let navigationController = UINavigationController(rootViewController: browserViewController)
navigationController.modalPresentationStyle = .fullScreen
present(navigationController, animated: true)

Custom presentation controllers and custom animators UIViewControllerInteractiveTransitioning, UIViewControllerAnimatedTransitioning are work in progress.

Customization

Providing the initial index

It is possible to set the initial displaying image index.

// images: [IFImage]
let viewController = IFBrowserViewController(images: images, initialImageIndex: .random(in: images.indices))

The IFBrowserViewController clamps the provided value to avoid unexpected crash.

Aspect fill images

The IFBrowserViewController allows you to decide whether the full-size image should be displayed using the aspect fill zoom if the aspect ratio is similar to its container view.

let viewController = IFBrowserViewController(
    images: images, 
    initialImageIndex: 0)

viewController.configuration.prefersAspectFillZoom = false 

let viewController = IFBrowserViewController(
    images: images, 
    initialImageIndex: 0)

viewController.configuration.prefersAspectFillZoom = true

Custom actions

It is possibile to create a custom action to allow user to interact with images.

browserViewController.configuration.actions = [.share, .custom(identifier: "cropAction", image: cropImage)]

Sharing and deleting actions are already managed by the IFBrowserViewController.

Then you can interact with them by implementing IFBrowserViewControllerDelegate:

func browserViewController(_ browserViewController: IFBrowserViewController, didSelectActionWith identifier: String, forImageAt index: Int) {
    switch identifier {
    case  "cropAction":
        // User tap on crop action
    default:
        break
    }
}

Dismiss button

The browser implements the default cancel bar button item when it is presented modally. You can provide your own bar button item by setting navigation item related-property:

browserViewController.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .close, target: self, action: #selector(closeButtonDidTap))

It is recommended to subclass IFBrowserViewController instead of provide a button with an another target

Navigation bar title

It is possible to provide a title or a title view to avoid automatic updates when a new image is about to be displayed.

browserViewController.navigationItem.titleView = CustomLabel(title: "ImageUI", subtitle: "My album")

More customization

You can adopt IFBrowserViewControllerDelegate and implement the following method in order to update the UI by your rules.

func browserViewController(_ browserViewController: IFBrowserViewController, willDisplayImageAt index: Int) {
    // A new image is about to be displayed
}

Contributing

ImageUI's roadmap is managed by Trello and is publicly available. If you'd like to contribute, please feel free to create a PR.

License

ImageUI is released under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].