Coder Social home page Coder Social logo

imageviewer's Introduction

ImageViewer

Do you have a bunch of images with meta information that you would like to go through (or share)?

This is a web-based image viewer for that.

It is a tiny flask app, built with bootstrap, which will display images and their meta information from a table with pagination. It could be a starting point for a more complex application.

WARNING: This app was built to run locally for my own convenience and to be shared with a small number of collaborators. In app.py, the entire table is loaded into a global variable table. This can be problematic if the table is large, and the app receives a lot of traffic, as it will load the data for every process. You'll want to setup a proper database. See

Test out

You can either run in a new conda environment or use docker.

  1. Create a new conda environment to install required packages locally:
git clone https://github.com/smoh/imageviewer
cd imageviewer
conda env create    # will create 'viewer' environment specified in environment.yml
source activate viewer
python app.py
  1. Use docker:
git clone https://github.com/smoh/imageviewer
cd imageviewer
docker-compose up --build

Once the app is running, point your browser to localhost:5000. This will show images inside example/images/ directory with the related information in fakecatalog.csv like this:

Configure static file paths in app.py and modify templates in templates/ according to your needs. Flask uses the jinja template engine.

imageviewer's People

Contributors

smoh avatar zigsphere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

imageviewer's Issues

Traversing through example/images

Hi,

I am having an issue with the static folder. I want the directory to be as such:
example
--> images
------------> 1
-------------------> image1.jpg
-------------------> image2.jpg
------------> 2
------------> 3

Therefore, how do I use the app.py and pager.py to traverse through the directory, such that I can receive image1.jpg on the index 1, and be able to view image2.jpg with a button on the same html page.

Working with databases

I am trying to get this to work with a database. This app works with a CSV file, but I want to get the data directly from a database, do you have any insight on this?

Pager Indexing @ 0

How would you recommend starting the pager indexer for this flask app at 1, not at 0?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.