Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.

fgallery example #27

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions examples/fgallery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Fgallery - Static image gallery

Fgallery comprises of some perl code, that can generate an image gallery built completely staticly with no server side code. This can then be easily hosted using ipfs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe one line beforehand could help the user get the motivation:

Hosting an image gallery on IPFS is very easy. In this example, we'll show how to add images to IPFS and how to add a web gallery, called Fgallery.


http://www.thregr.org/~wavexx/software/fgallery/

## Dependencies

Fgallery reqires a few dependencies to work, on Ubuntu 14.04 I needed:

```
Perl, with the following modules (which can be installed from CPAN):
Image::ExifTool
JSON

imagemagick
liblcms2-utils
exiftran
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe list the commands that install them?


## Building the gallery

Fistly, you'll need to prepare a directory with your images in, you can either make your own or use the demo one provided. Make a note of where it's located on the file system.

The latest version of fgallery can be downloaded from their website, unzip the archive and change directory into the extracted folder.

Run:

```
./fgallery /demo /gallery
```

You'll need to give the full path to where you placed the demo folder.

Fgallery will then start processing images and building all the static files in the output directory:

```
reading completed
processing completed
generating archive...
completed
```

## Hosting with IPFS

Putting the images online is done with just one command:

```
ipfs add -r /gallery
```

Obviously replacing /output/location with the location you asked fgallery to output the files to.

This will add all of the files:

```
added QmYby7AidsKyM29z5TgVH6CGFkj5k9mauzJSSdRXmqoqXZ gallery/back.png
added Qma6c2Cz4Wp9ZsdtMUxzmc1rfTN1QewSdDkjdkqYkoYKJZ gallery/blurs/01O0FMD.jpg
added QmemKBx9awiTz6GubFuW6dQ3M7RnM7wiXaN6sA3NVXEAHM gallery/blurs/03Kj6JO.jpg
added QmZxRcxLzEvMiqEPxXECz8d2XdwCL9KvS9zKjVYHkw4t3P gallery/blurs/04CVyjY.jpg
added QmSTHdib78JDtPyWR498CbYnYWExVJLzD1298utjgMZkJj gallery/blurs/05vYu5k.jpg
added QmWKJo49HxhFnvTEW8r9D8vV7ezytn2n3u9XR2QhsUNAe2 gallery/blurs/06YYa0i.jpg
added Qmbc9U7yJKVRGWarSzDqFsFPZ5U4oFr3rnu7CMzxPSLj9R gallery/blurs/06uDGyB.jpg
added QmU3ski5amcbK1wQZVLHAhYpJRyv1vWfwVEfcJB5iRrzQ2 gallery/blurs/07v5H70.jpg
added QmWFVgR6i81FUXTS9HxppL8y1hy4DmqyS3Xse2uiGLmosj gallery/blurs/07vVDJI.jpg
added QmVmZBm5j6HZcAdYnPNJaSFL1FRxkyPkzJ7ixno1mGUNi4 gallery/blurs/097mGzX.jpg
added QmQMbgdCgNmSXJSoqm46nDq5QUjAduZ2RRRhgeB8pFnfmU gallery/blurs/0AKuTh0.jpg
added QmYjMJSrg3eWLEkH94Js2i8EgHWEgbYFV775BnPtPWMkdf gallery/blurs/GdRkiQe.jpg
added QmWhZjvDXM9W4Es2ZFeqYUSZgfB7B5URxCgXHcnjs2d9gk gallery/blurs
added QmPGmwDDBvbh3WwdPmwomBaVkRPcwKxjBqhBwuixoKQ5Ax gallery/cut-left.png
added QmUTzLj5XovXtrVKxNCEV2gewn3uHKuUt2CvfBVMn3aS6F gallery/cut-mov.png
added Qme591h16sr4d1GAd9DTQj2MzS7SGCDddaTjW9X8pmtdQP gallery/cut-right.png
added Qmdh4iSEzJ4JJ8TxpJqMWEFrEJGTXnibMycjFEi5fA2ga2 gallery/cut-top.png
added QmNZhsytZxPJYkYLFsR7p1xgusaDUq4XqPo7JxVjeokMAA gallery/data.json
added Qmc6QSF5vfAKAvRUmeozG39BnomLcjyGCcREbRFCxCGzbx gallery/download.png
added QmVwtBtRCngQJrPcFeq3DSa96FyLqBi7bfMQcSKxcDqLhU gallery/eye.png
added QmNbsd4SMzxSRNUm9J3a5sgBJg8H3tJUGU5bjJVRKkYugD gallery/files/album.zip
added Qma7ZL21cVBTYpMPFx9Z3TKiX3FWgwGog6LqWV8TzMXdrz gallery/files
added QmYksDd1jEtz6kcYb2A7WXiHd2e9iNjtRWhytbQ9pS9SeU gallery/imgs/01O0FMD.jpg
added QmTtYSk393PnukPUGtJtQiiT88ToMsq1rTi6DmZaT4NNiT gallery/imgs/03Kj6JO.jpg
added QmTSJAEzzrTxZc7QCYKquTnxYy93mMeBcxtzxFeVFfZfUU gallery/imgs/04CVyjY.jpg
added QmSbKdZoQfuuXCfkcvJHLVJEAxSf3e3ynpiB9tERJ4otgW gallery/imgs/05vYu5k.jpg
added Qme3prmgJwo3Y2Ao8H1XEcaRq5ZGCgySR4xskJJXBXsfty gallery/imgs/06YYa0i.jpg
added QmQZZjigYvdWdCigVh8icbRNiYueihHHRrVTc3A6RBQpx9 gallery/imgs/06uDGyB.jpg
added Qmbr6nyNEQR3STZ1WFg73Qh7HjjqQfQkJMeBaqiu1BzezW gallery/imgs/07v5H70.jpg
added QmcBkLJWpsG75yZbQnmcKrS2gvNKho44R9rS5mKuEi9uqo gallery/imgs/07vVDJI.jpg
added QmceXN5f82R5Rd8MCvhSUgR8ZA4SgNBSya1vg3hByVKwHu gallery/imgs/097mGzX.jpg
added QmQh7L4vTGGPuV7CbHVBgx7S6Y173oAUXDgE6bVTa6mdjW gallery/imgs/0AKuTh0.jpg
added QmQrryUqtM4UYYVLXiKbhyxBy9i75p46tHMHABrBQDqPWf gallery/imgs/GdRkiQe.jpg
added QmTQzSHt6B92KPzhtdtGE6DP7dvVJzCP2PuRrxZXJeekPX gallery/imgs
added QmUpYBMVqDrhfBCK2ghHjoaX62fQtgrrCxfabaAwYjeDSe gallery/index.css
added QmQeGFPJ6FrjG4GsiTZswZJac7dmLo6G21x9zoFZ1naczr gallery/index.html
added QmRVVLVVcvQnr4mwiNU266SQ49z3BosaiumjT9aydL54HC gallery/index.js
added QmQ1ERFyV2MxhFC5ng1ttVdg86dafivgQyLkwtWbmyHKjV gallery/left.png
added QmQKrKStaD7ijv2A4LP5weMwyXn9mZ6FJEpd4kax85W69h gallery/mootools-core-1.4.js
added Qmd9w91XMVfjHud9mTtGaAKJsxwCEZB2GaoVUA9j7s2oJz gallery/mootools-idle.js
added QmcJ7TBvQHCeQgBkJnidzZWoWDyDErq6BtrVCTAyCsmy3Y gallery/mootools-mooswipe.js
added QmWtHAixSGya2jToEWvAxLeKhiT1dkcXQr6kg7f6nPFdSq gallery/mootools-more-1.4.js
added QmTq42T1LBXiubNNEiGN8howjGKFWYPGUuiZQU68ffqvaq gallery/noise.png
added QmRziDBMHQZybCWF5s7kbe8MdQxugbmXR1WCgaLLGya4jb gallery/right.png
added QmQvs1n39aE9Ey7fFiBkKfNyJvST5LqTjMSUz9MWvKPMeb gallery/throbber.gif
added QmedcnTL7w34755XxnBMCf5zdXu4s57hkPsNxb7fDcVBJj gallery/thumbs/01O0FMD.jpg
added QmNvz7ZjBRo5TRiKgmw3JuhAvmvGibYmVHs7tdGmdKDF2H gallery/thumbs/03Kj6JO.jpg
added QmSopgp2tbbPh1TvTVjutWaAyAf4wfUTiwh65VHR56ZRVi gallery/thumbs/04CVyjY.jpg
added QmfDUXqikZQtx984nwkgf2uvm1H9qCzSkHkeaDvhKLZvoL gallery/thumbs/05vYu5k.jpg
added QmaknQgxfX2MS3We17EzVRssCmr53DzKmbz94bzLXmpKEE gallery/thumbs/06YYa0i.jpg
added QmU4YBZGAG5A7kmQmYZGJMc6z51kdnjtJY2RUfHoZrMw37 gallery/thumbs/06uDGyB.jpg
added QmY2K9Zd2kPntvwenjizWt7fGQvptLia94vkS5ejewkiKH gallery/thumbs/07v5H70.jpg
added QmVofJdrSKXeALbnDi6wesCciCs5weg51aXzD3AR9CU1ug gallery/thumbs/07vVDJI.jpg
added QmRCHjy36Dh9WwaNi6Tj2wAJvqF4cKaaJJwMku5micERX1 gallery/thumbs/097mGzX.jpg
added QmR2YruXg2mujXax6cKuQTHKSJ5zZvLCsCKX6MRnkGVKao gallery/thumbs/0AKuTh0.jpg
added QmQM49GgBY3WNEtT9xTiQrBEuVvYtAgcsG4scL3mQbaCRL gallery/thumbs/GdRkiQe.jpg
added QmUYC9AuQYAQPNCannRUyiNg94MbRHXUZYktMNRqwJbfvF gallery/thumbs
added QmedGgNBaGUDsc8anZ3LZ6HNjfKcoZGDpjoPxXwwKWjK2p gallery
```

Take the hash of the folder, in this case "QmedGgNBaGUDsc8anZ3LZ6HNjfKcoZGDpjoPxXwwKWjK2p", and add it to http://ipfs.io/ipfs/ to see the gallery live:

https://ipfs.io/ipfs/QmedGgNBaGUDsc8anZ3LZ6HNjfKcoZGDpjoPxXwwKWjK2p
Binary file added examples/fgallery/demo/01O0FMD.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/demo/03Kj6JO.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/demo/04CVyjY.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/demo/05vYu5k.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/demo/06YYa0i.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/demo/06uDGyB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/demo/07v5H70.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/demo/07vVDJI.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/demo/097mGzX.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/demo/0AKuTh0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/demo/GdRkiQe.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/blurs/01O0FMD.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/blurs/03Kj6JO.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/blurs/04CVyjY.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/blurs/05vYu5k.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/blurs/06YYa0i.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/blurs/06uDGyB.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/blurs/07v5H70.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/blurs/07vVDJI.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/blurs/097mGzX.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/blurs/0AKuTh0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/blurs/GdRkiQe.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/cut-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/cut-mov.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/fgallery/output/cut-right.png
Binary file added examples/fgallery/output/cut-top.png
1 change: 1 addition & 0 deletions examples/fgallery/output/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"blur":[600,336],"thumb":{"min":[150,112],"max":[267,200]},"data":[{"thumb":["thumbs/01O0FMD.jpg",[173,112]],"stamp":1,"blur":"blurs/01O0FMD.jpg","img":["imgs/01O0FMD.jpg",[1600,1035]]},{"thumb":["thumbs/03Kj6JO.jpg",[199,112]],"blur":"blurs/03Kj6JO.jpg","stamp":2,"img":["imgs/03Kj6JO.jpg",[1600,900]]},{"img":["imgs/04CVyjY.jpg",[1600,1063]],"stamp":3,"blur":"blurs/04CVyjY.jpg","thumb":["thumbs/04CVyjY.jpg",[169,112]]},{"stamp":4,"blur":"blurs/05vYu5k.jpg","img":["imgs/05vYu5k.jpg",[1600,900]],"thumb":["thumbs/05vYu5k.jpg",[199,112]]},{"img":["imgs/06uDGyB.jpg",[1600,900]],"blur":"blurs/06uDGyB.jpg","stamp":5,"thumb":["thumbs/06uDGyB.jpg",[199,112]]},{"img":["imgs/06YYa0i.jpg",[1600,900]],"blur":"blurs/06YYa0i.jpg","stamp":6,"thumb":["thumbs/06YYa0i.jpg",[199,112]]},{"img":["imgs/07v5H70.jpg",[1600,900]],"blur":"blurs/07v5H70.jpg","stamp":7,"thumb":["thumbs/07v5H70.jpg",[199,112]]},{"thumb":["thumbs/07vVDJI.jpg",[150,113]],"img":["imgs/07vVDJI.jpg",[1600,1200]],"stamp":8,"blur":"blurs/07vVDJI.jpg"},{"stamp":9,"blur":"blurs/097mGzX.jpg","img":["imgs/097mGzX.jpg",[1600,900]],"thumb":["thumbs/097mGzX.jpg",[199,112]]},{"thumb":["thumbs/0AKuTh0.jpg",[199,112]],"blur":"blurs/0AKuTh0.jpg","stamp":10,"img":["imgs/0AKuTh0.jpg",[1600,900]]},{"img":["imgs/GdRkiQe.jpg",[1594,1200]],"blur":"blurs/GdRkiQe.jpg","stamp":11,"thumb":["thumbs/GdRkiQe.jpg",[150,113]]}],"download":"files/album.zip"}
Binary file added examples/fgallery/output/download.png
Binary file added examples/fgallery/output/eye.png
Binary file added examples/fgallery/output/files/album.zip
Binary file not shown.
Binary file added examples/fgallery/output/imgs/01O0FMD.jpg
Binary file added examples/fgallery/output/imgs/03Kj6JO.jpg
Binary file added examples/fgallery/output/imgs/04CVyjY.jpg
Binary file added examples/fgallery/output/imgs/05vYu5k.jpg
Binary file added examples/fgallery/output/imgs/06YYa0i.jpg
Binary file added examples/fgallery/output/imgs/06uDGyB.jpg
Binary file added examples/fgallery/output/imgs/07v5H70.jpg
Binary file added examples/fgallery/output/imgs/07vVDJI.jpg
Binary file added examples/fgallery/output/imgs/097mGzX.jpg
Binary file added examples/fgallery/output/imgs/0AKuTh0.jpg
Binary file added examples/fgallery/output/imgs/GdRkiQe.jpg
Loading