GithubHelp home page GithubHelp logo

sahwar / chibipaint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thenickdude/chibipaint

0.0 2.0 0.0 3.92 MB

Chicken Smoothie's modified version of Marc Schefer's ChibiPaint

License: GNU General Public License v3.0

Makefile 0.08% IDL 2.49% Batchfile 0.03% Shell 0.07% HTML 8.62% CSS 0.08% Java 88.59% Prolog 0.04%

chibipaint's Introduction

    ChibiPaint

    Copyright (c) 2006-2008 Marc Schefer

    This file is part of ChibiPaint.

    ChibiPaint is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    ChibiPaint is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with ChibiPaint. If not, see <http://www.gnu.org/licenses/>.

  CHIBIPAINT
  
  ChibiPaint is an oekaki applet. A software that allows people to draw and paint online and share the result with
  other art enthusiasts. It's designed to be integrated with an oekaki board, a web server running dedicated software.
  Several are available but we don't currently provide an integrated solution for ChibiPaint.
  
  INTEGRATION
  
  ChibiPaint is still in the alpha stage of its development and the following integration specs are likely to evolve
  in the future.
  
  APPLET PARAMETERS
  
  Here's an example on how to integrate the applet in a html webpage
  
    <applet archive="chibipaint.jar" code="chibipaint.ChibiPaint.class" width="800" height="600">
      <param name="canvasWidth" value="400" />
      <param name="canvasHeight" value="300" />
      <param name="postUrl" value="http://yourserver/oekaki/cpget.php" />
      <param name="exitUrl" value="http://yourserver/oekaki/" />
      <param name="exitUrlTarget" value="_self" />
      <param name="loadImage" value="http://yourserver/oekaki/pictures/168.png" />
      <param name="loadChibiFile" value="http://yourserver/oekaki/pictures/168.chi" />
      JAVA NOT SUPPORTED! <!-- alternative content for users who don't have Java installed -->
    </applet>
  
  The parameters are:
  canvasWidth - width of the area on which users can draw (currently capped to 1024)
  canvasHeight - height of the area on which users can draw (currently capped to 1024)
  
  postUrl - url that will be used to post the resulting files (see below for more details)
  exitUrl - after sending the oekaki the user will be redirected to that url
  exitUrlTarget - optional target to allow different frames configuration
  
  loadImage - an image (png format) that will be loaded in the applet to be edited
  loadChibiFile - a chibifile format (.chi) multi-layer image that will be loaded in the applet to be edited

  NOTE: The last two parameters can be omited when they don't apply. If both loadImage and loadChibiFile are specified,
        loadChibiFile takes precedence
  
  POST FORMAT
  
  The applet will send the resulting png file and optionally a multi-layer chibifile format file.
  
  The files are sent as a regular multipart HTTP POST file upload, similar to the one used by form based file uploads
  for ease of processing by the server side script. 
  
  The form data name for the png file is 'picture' and 'chibifile' for the multilayer file. The recommended extension
  for chibifiles is '.chi'
  
  The applet expects the server to answer with the single line reply "CHIBIOK" followed by a newline character.
  
  "CHIBIERROR" followed by an error message on the same list is the planned way to report an error but currently the
  applet will just ignore the error message and report a failure on any reply except CHIBIOK.
  
  PHP EXAMPLE
  
  Here's an example of how a php script might handle the applet's POST
  
  <?php
    if (isset($_FILES["picture"]))
    {
      header ('Content-type: text/plain');

      $uploaddir = $_SERVER["DOCUMENT_ROOT"].'/oekaki/pictures/';
      $file = $_FILES['picture']['name'];
      $ext = (strpos($file, '.') === FALSE) ? '' : substr($file, strrpos($file, '.'));
      $uploadfile = $uploaddir . time();

      $success = TRUE;
      if (isset($_FILES["chibifile"]))
        $success = $success && move_uploaded_file($_FILES['chibifile']['tmp_name'], $uploadfile . ".chi");

      $success = $success && move_uploaded_file($_FILES['picture']['tmp_name'], $uploadfile . $ext);
      if ($success) {
        echo "CHIBIOK\n";
      } else {
        echo "CHIBIERROR\n";
      }
    }
    else
      echo "CHIBIERROR No Data\n";
  ?>
  
  CONTACT INFORMATION
  
  Author: Marc Schefer ([email protected])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.