Image Splitter is a powerful PHP script that automates the process of splitting images into smaller grid-based parts. Ideal for creating image puzzles, mosaic art, and other creative projects, this tool features dynamic output directory creation, input validation, and error handling.
Topics: php
, mysql
, blog
, ajax
, bootstrap
, jquery
, css
, image gallery
, file upload
, image-processing
, data-augmentation
, image-splitting
, image-magick
, drag-and-drop-upload
-
Clone the Repository:
git clone https://github.com/your-username/simple-image-splitter-tool-app.git
-
Navigate to the Project Directory:
cd image-splitter-tool
-
Setup Database:
- Create a MySQL database named
image_splitter
. - Import the provided SQL file to create the necessary table:
mysql -u yourusername -p image_splitter < db/database.sql
- Create a MySQL database named
-
Update Database Configuration:
- Copy
config.sample.php
toconfig.php
:cp config.sample.php config.php
- Open
config.php
and update the database configuration details.
- Copy
-
Install ImageMagick:
- Ensure ImageMagick is installed on your server.
- You can check installation using the following command:
convert --version
-
Set Permissions:
- Ensure the
assets/uploads
andoutput
directories are writable.
chmod -R 0777 assets/uploads chmod -R 0777 output
- Ensure the
-
Start the development server:
php -S localhost:8000
-
Access the application:
- Open your web browser and navigate to
http://localhost:8000
. - Upload an image using the drag-and-drop interface and configure the splitting options.
- Open your web browser and navigate to
Here’s a basic file structure for your simple-image-gallery application:
simple-image-splitter-tool-app/
│
├── index.html
├── db/
│ └── database.sql
├── src/
│ ├── fetch-image.php
│ └── upload.php
├── include/
│ ├── config.sample.php
│ └── db.php
├── assets/
│ ├── css/
│ │ └── style.css
│ ├── js/
│ │ └── script.js
│ └── uploads/
│ │ └── (uploaded images will be stored here)
├── README.md
└── .gitignore