{"id":19081459,"url":"https://github.com/droduit/pictdbm","last_synced_at":"2025-02-22T06:13:35.167Z","repository":{"id":84412968,"uuid":"115329502","full_name":"droduit/pictDBM","owner":"droduit","description":"⚙️ Pictures Database Manager","archived":false,"fork":false,"pushed_at":"2023-08-05T10:27:52.000Z","size":2518,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-02T20:19:02.512Z","etag":null,"topics":["haystack","image-database","vips"],"latest_commit_sha":null,"homepage":"https://dominique.roduit.com/en/pict-dbm","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/droduit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-25T10:29:11.000Z","updated_at":"2023-08-04T13:17:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"2856655b-1482-457d-b33d-8fcdab45f5c9","html_url":"https://github.com/droduit/pictDBM","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droduit%2FpictDBM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droduit%2FpictDBM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droduit%2FpictDBM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droduit%2FpictDBM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/droduit","download_url":"https://codeload.github.com/droduit/pictDBM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240131746,"owners_count":19752727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haystack","image-database","vips"],"created_at":"2024-11-09T02:35:37.373Z","updated_at":"2025-02-22T06:13:35.148Z","avatar_url":"https://github.com/droduit.png","language":"C","readme":"# Pictures Database Manager\n\n## Description\nThis project is a command line utility tool for managing images in a specific format database. This is an inspired and simplified version of the \"\u003ca href=\"https://www.usenix.org/event/osdi10/tech/full_papers/Beaver.pdf\"\u003eHaystack\u003c/a\u003e\" system used by Facebook.\n\nSocial networks have to manage hundreds of millions of images. Usual file systems (such as the one used on your hard disk) have efficiency problems with such numbers of files. Moreover, they are not designed to handle the fact that we want to have each of these images in several resolutions, for example very small (icon), medium for a quick \"preview\" and in normal size (original resolution ).\n\nIn the “Haystack” approach, several images are in the same file. Also, different resolutions of the same image are stored automatically. This single file contains both data (images) and metadata\n(information about each image). The key idea is that the image server has a copy of this metadata in memory, in order to allow very fast access to a specific photo, and in the correct resolution.\n\nThis approach has a number of advantages: first, it reduces the number of files managed by the operating system; on the other hand, it makes it possible to elegantly implement two important aspects of the management of an image database:\n\u003col\u003e\u003cli\u003eautomatic management of different image resolutions, in our case the three supported resolutions;\u003c/li\u003e\n\u003cli\u003ethe possibility of not duplicating identical images submitted under different names (eg by different users at Facebook); it is an extremely useful optimization in any social network.\u003c/li\u003e\u003c/ol\u003e\n\nThis “deduplication” is done using a “hash function” which summarizes binary content (in our case an image) into a much shorter signature. We use here the “SHA-256” function which summarizes all binary content in 256 bits, with the interesting cryptographic property that the function is resistant to collisions: for a given image, it is practically impossible to create another image which would have the same signature.\n\n## Preview\n![pictDBM_server](https://user-images.githubusercontent.com/9269271/210625164-04890801-e3f2-4515-b4fe-b74d411e29ca.png)\n\n## How to install\n\n1. Clone this git repository locally\n2. Make sure the following packages are installed :\n    - [glib](https://docs.gtk.org/glib/)\n    - [pkg-config](https://en.wikipedia.org/wiki/Pkg-config)\n    - [libvips](https://github.com/libvips/libvips/tree/master)\n    \n    If not, MacOS: `brew install libvips pkg-config`\n\n3. From the root of the project, run `cd libmongoose \u0026\u0026 make clean \u0026\u0026 make all`.\n4. From the root of the project, run `make clean-all \u0026\u0026 make all`.\n5. Copy `libmongoose/libmongoose.so` into the root folder: `cp libmongoose/libmongoose.so libmongoose.so`.\n6. Run the server with `make server`.\n7. Open `localhost:8000` on any browser. \n\n## Makefile commands\n\n* `make clean-all` Clear all objects files and executables generated by a call to `make`\n* `make server` Launch the server, reachable on your web browser at `localhost:8000` (default value)\n* `make style` Apply `astyle` on the whole project's `.c` and `.h` files\n* \n## Commands available\n```java\n./pictDBM [COMMAND] [ARGUMENTS]\n```\n* \u003ccode\u003e**help**\u003c/code\u003e\n\u003ci\u003edisplays this help.\u003c/i\u003e\n\n* \u003ccode\u003e**list** \u0026lt;dbfilename\u0026gt;\u003c/code\u003e\n\u003ci\u003elist pictDB content.\u003c/i\u003e\n\n* \u003ccode\u003e**create** \u0026lt;dbfilename\u0026gt; [options]\u003c/code\u003e\n\t\u003ci\u003ecreate a new pictDB\u003c/i\u003e.\u003cbr\u003e\n\t\n\t\toptions are: \n\t\t\t-max_files \u003cMAX_FILES\u003e : maximum number of files.\n\t\t\t-thumb_res \u003cX_RES\u003e \u003cY_RES\u003e : resolution for thumbnail images.\n\t\t\t-small_res \u003cX_RES\u003e \u003cY_RES\u003e : resolution for small images.\n\n\n* \u003ccode\u003e**read** \u0026lt;dbfilename\u0026gt; \u0026lt;pictID\u0026gt; [original|orig|thumbnail|thumb|small]\u003c/code\u003e\u003cbr\u003e\n\t\u003ci\u003eread an image from the pictDB and save it to a file.\u003cbr\u003e\n\tdefault resolution is \"original\".\u003c/i\u003e\n\n* \u003ccode\u003e**insert** \u0026lt;dbfilename\u0026gt; \u0026lt;pictID\u0026gt; \u0026lt;filename\u0026gt;\u003c/code\u003e\u003cbr\u003e\n\t\u003ci\u003einsert a new image in the pictDB.\u003c/i\u003e\n\n* \u003ccode\u003e**delete** \u0026lt;dbfilename\u0026gt; \u0026lt;pictID\u0026gt;\u003c/code\u003e\u003cbr\u003e\n\u003ci\u003edelete picture pictID from pictDB.\u003c/i\u003e\n\n* \u003ccode\u003e**gc** \u0026lt;dbfilename\u0026gt; \u0026lt;tmp dbfilename\u0026gt;\u003c/code\u003e\u003cbr\u003e\n\u003ci\u003eperforms garbage collecting on pictDB. Requires a temporary filename for copying the pictDB.\u003c/i\u003e\n\n## Authors\n\n- Dominique Roduit ([@droduit](https://github.com/droduit))\n- Thierry Treyer ([@ttreyer](https://github.com/ttreyer))\n\n## Note\n\nProject completed within the context of the EPFL course « [System programming project](https://edu.epfl.ch/coursebook/en/system-programming-project-CS-212) »","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdroduit%2Fpictdbm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdroduit%2Fpictdbm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdroduit%2Fpictdbm/lists"}