{"id":24522100,"url":"https://github.com/nickssilver/base64-image-encoder","last_synced_at":"2025-07-29T18:05:05.039Z","repository":{"id":110621836,"uuid":"534231645","full_name":"nickssilver/base64-image-encoder","owner":"nickssilver","description":" Base64 image encoder written in C ","archived":false,"fork":false,"pushed_at":"2022-09-25T19:23:29.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T13:11:33.110Z","etag":null,"topics":["c","encoder-decoder"],"latest_commit_sha":null,"homepage":"","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/nickssilver.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":"2022-09-08T13:44:32.000Z","updated_at":"2022-09-09T19:30:53.000Z","dependencies_parsed_at":"2023-06-29T08:14:28.814Z","dependency_job_id":null,"html_url":"https://github.com/nickssilver/base64-image-encoder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nickssilver/base64-image-encoder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickssilver%2Fbase64-image-encoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickssilver%2Fbase64-image-encoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickssilver%2Fbase64-image-encoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickssilver%2Fbase64-image-encoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickssilver","download_url":"https://codeload.github.com/nickssilver/base64-image-encoder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickssilver%2Fbase64-image-encoder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267729736,"owners_count":24135376,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c","encoder-decoder"],"created_at":"2025-01-22T03:17:52.959Z","updated_at":"2025-07-29T18:05:05.032Z","avatar_url":"https://github.com/nickssilver.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \n\u003ch1 align =\"center\"\u003ebase64-image-encoder:monocle_face:\u003c/h1\u003e\u003cbr\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://i2.wp.com/www.fatosmorina.com/wp-content/uploads/2017/07/Base64.png\"\u003e\n\u003c/p\u003e\n\u003chr /\u003e\n\nBase64 image encoder written in C.\n\n## Repo Description\n\nBase64 is an encoding algorithm that converts any characters, binary data, and even images or sound files into a readable string, which can be saved or transported over the network without data loss. The characters generated from Base64 encoding consist of Latin letters, digits, plus, and slash. Base64 is most commonly used as a `MIME` (Multipurpose Internet Mail Extensions) transfer encoding for email.\n\nBase64 images are primarily used to embed image data within other formats like HTML, CSS, or JSON. By including image data within an HTML document, the browser doesn't need to make an additional web request to fetch the file, since the image is already embedded in the HTML document. A Base64 representation of an image is larger than a separate image and the string gets very long for large images. You should primarily use Base64 for small images and always test both embedded and external images to see what works best.\n\nOnce converted to Base64, encoded image data will look similar to this (shortened for simplicity):\n```\niVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgwnLpRPAAA...\n```\nThe string can be used instead of an URL in the src attribute of the img element in HTML:\n```\n\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzA...\" /\u003e\n```\nOr you can insert the string as a background-image in CSS:\n```\nbackground-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzA...\");\n```\nOther file types like XML and JSON also supports Base64 encoded images. Start by uploading an image file above and play with the different possibilities.\n\n## Assumptions\n\nYou are building and running this application on a Debian-based Linux machine. Other distros and operating systems may have varied results. \n\n## Dependencies and prerequisites\nHave libcurl package installed. To install:\n\n`$ sudo apt-get install libcurl4-openssl-dev`\n\nDownload and extract the libcurl library in the same location where you will clone the github repository\n\n[Download](https://curl.se/download.html)\n\n## Installing the application locally\nClone the repository:\n\n`$ git clone https://github.com/nickssilver/base64-image-encoder.git`\n\nIn the root directory of the repository, set the `LD_LIBRARY_PATH` environment variable to the current directory:\n\n`$ export LD_LIBRARY_PATH=$(pwd)`\n\nCreate the object file:\n\n`$ gcc -c -Wall -Werror -fpic libencode.c`\n\nCreate a shared library from the object file:\n\n`$ gcc -shared -o libencode.so libencode.o`\n\n## Running the application locally\nCompile the executable:\n\n`$ gcc -L$(pwd) -Wall -o encode main.c -lencode -lcurl`\n\nMove empty file to write into root directory, or create it:\n\n`$ touch filename`\n\nRun the executable with an image link and file name:\n\n`$ ./encode https://www.image.png filename`\n\n \n# Author:\n- *Nicholas M. Gitobu*  - [@nickssilver](https://github.com/nickssilver)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickssilver%2Fbase64-image-encoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickssilver%2Fbase64-image-encoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickssilver%2Fbase64-image-encoder/lists"}