Online photo cropper and image editor plugin script
for developers of web based software

Developer Installation and Configuration Help

Introduction

In order to install and configure the Crop2Size™ web-based image cropping tool, it is recommended that the person installing Crop2Size™ have a working technical knowledge of the following topics:

  • Website application installation and management
  • The server directory structure
The following instructions pertain to installing Crop2Size™ on your server, integrated with your own software. If you are installing in FCKeditor, Joomla or Zen Cart, please use the instructions linked below instead.

Prerequisite Checklist

Before installing the program, the following components must be installed and operational:

  • PHP4 or PHP5
  • GD Library 2.0.1 or later, or an API equivalent
  • WinZip® file compression utility or equivalent

In addition, you must have previously downloaded the Crop2Size™ distribution package to your server.

Installing Crop2Size™ onto the Server

The following instructions pertain to installing Crop2Size™ on your server, integrated with your own software. If you are installing in FCKeditor, Joomla or Zen Cart, please use the instructions linked above instead.

  1. Decompress all compressed files into a web-accessable directory on your server.
  2. If you are installing on a Windows server, skip to step 3. If you are installing on Linux, follow these instructions:

    Setting Server and Log File Permission Levels

    You must set permission levels for the appropriate directories and log files so that the configuration script can create the necessary files and folders.

    Note: You must set the permission levels prior to running the the configuration script.

    Your server needs read permissions on all Crop2Size™ directories and write permissions ("chmod 0775") on:


    • crop2size/crop2size
    • crop2size/crop2size/scripts
    • crop2size/crop2size/xml
    • crop2size/crop2size/tmp
    • your gallery directory (default: crop2size/crop2size/gallery)
    • your gallery icon directory (default: crop2size/crop2size/gallery/icons)

    If you are running the mod_secure firewall module you will need to make the following additional changes:

    In the root directory of your website add a .htaccess file containing the following lines:
    SecFilterEngine Off
    SecFilterScanPOST Off

  3. Using a standard web browser, run the crop2size/crop2size/configure.php script file. (See below for details)

    For example: http://yoursite.com/somepath/crop2size/crop2size/configure.php
    where "yoursite.com" is your server or domain name and "somepath" is the path from your web root to the Crop2Size™ installation.

  4. If you are installing on a Windows server, skip this step. If you are installing on Linux, follow this instruction:
    Once you are done with configuration, you may remove write permissions from:
    • crop2size/crop2size/scripts
    • crop2size/crop2size/xml
    If you wish to reconfigure in the future, you will need to add write permissions to these again.

Configuring Crop2Size™ on the Server

Following are the specific parameters requested by the configure.php script. You must successfully run configure.php once during the installation procedure. You can always change these later by running configure.php again.

  • Relative URL of the base directory of the Crop2Size™ application.

    This parameter should point from your web root to the Crop2Size™ installation. For example: if configure.php Crop2Size™ is at http://yoursite.com/somepath/crop2size/crop2size/configure.php, you would put "/somepath/"

  • Title for Crop2Size.

    Change the text to be shown at the top of the Crop2Size™ application. The default text is "Crop2Size".

  • Alternative save text.

    The default is "Save to Server" for the standalone configuration.

  • Maximum upload file size.

    Allows you to restrict the file size of images used in the program.

  • The location for the php style error logfile.

    Specify a directory which is writable by your web server, and a file name.

  • The location for the trace debug file.

    Specify a directory which is writable by your web server, and a file name.

  • Delete gallery images after...

    Specify a maximum lifespan of gallery images

  • Expire editing session and delete work images after...

    Specify a maximum lifespan for temporary images used in processing

  • Version of the cropper to use

    Ensure that Standalone is selected.

  • Disable the Collapse option on the cropper

    By default the cropper always stays full size, but there is an option to allow the right side menu area to collapse when not in use

  • Start the cropper with the menu collapsed

    If you do not disable collapse, this allows you to choose whether the program starts collapsed or expanded

  • Allow saving to the server

    Choose "No" if you want to restrict users to saving images locally

  • Include Webcam capture

    Allow acquiring images directly from a webcam

  • Directory for gallery

    The path from crop2size/Crop2Size™ to your gallery directory. Note that this can be changed dynamically by setting a session variable called "gallerydir". See Configuring the Save Location instructions below.

  • JPEG Image Quality

    What quality value to use for saving images. Higher values (closer to 100) give higher image quality but also larger files. Lower values (closer to 1) give smaller files but also lower image quality. Default is 70.

Completing the Crop2Size™ Installation

Point your browser to crop2size/crop2size/crop2size.html and verify that Crop2Size™ functions correctly.

Configuring the Save Location

Images can be saved in two ways: to the user's local machine and to a gallery on the server. You can change where the gallery resides by setting the gallery directory during standard configuration (see above). But you can also change the gallery directory dynamically by setting a session variable called "gallerydir".

For example, you could have users log in to your php website and set the "gallerydir" session variable based on their user data. Crop2Size™ will then use that user-specific gallery directory for the duration of the user's session.

Remember that the "gallerydir" variable must be a path from crop2size/Crop2Size™ to your preferred gallery directory. If you wish to have the gallery directory reside outside of the Crop2Size™ directories, your path must start with "../../".

Licensing

If you have received a 30-day trial license or have purchased a license from Crop2Size.com, place the license.key file you received in the crop2size/crop2size/ directory and ensure that the webserver has read permissions on the file. With the file in place, clear your browser's cache and run Crop2Size. The program should no longer show the "DEMO" watermark on all images.

More Information

For additional information, see the list of Frequently Asked Questions (FAQs).