A web application that converts Base64 encoded strings to animated GIFs. Works on both desktop and mobile browsers, and can be deployed to a server.
- Convert Base64 strings to animated GIFs directly in the browser
- Responsive design that works on both desktop and mobile devices
- Upload Base64 data from a text file
- Download converted GIFs
- Server version for deployment
- Database storage for conversion history
-
Install the required dependencies:
pip install -r requirements.txt
-
Create your own configuration file:
- Copy
config.py.example
toconfig.py
- Update the database configuration in
config.py
with your MySQL credentials
- Copy
-
Run the server:
python server.py
-
Open your browser and go to
http://localhost:5000
- Open
index.html
in your browser - Paste your Base64 string into the text area or upload a file containing Base64 data
- Click "Convert to GIF"
- View the converted GIF and download it if needed
-
Install the required dependencies:
pip install -r requirements.txt
-
Create your own configuration file:
- Copy
config.py.example
toconfig.py
- Update the database configuration in
config.py
with your MySQL credentials
- Copy
-
Run the server:
python server.py
-
Open your browser and go to
http://localhost:5000
To deploy this application to a server:
-
Copy all files to your server
-
Install the required dependencies:
pip install -r requirements.txt
-
Create your own configuration file:
- Copy
config.py.example
toconfig.py
- Update the database configuration in
config.py
with your MySQL credentials
- Copy
-
Run the server:
python server.py
-
Configure your web server (nginx, Apache, etc.) to proxy requests to the Flask application
The server provides API endpoints for Base64 to GIF conversion:
- URL:
/api/convert
- Method:
POST
- Data:
{ "base64": "base64_encoded_string" }
- Response:
{ "success": true, "gif_data": "base64_encoded_gif_data" }
- URL:
/api/history
- Method:
GET
- Response:
{ "success": true, "history": [ { "id": 1, "created_at": "2023-06-01T10:00:00.000Z" } ] }
The application uses a MySQL database with the following schema:
CREATE TABLE conversions (
id INT AUTO_INCREMENT PRIMARY KEY,
base64_data LONGTEXT NOT NULL,
gif_data LONGBLOB NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
MIT