Giter VIP home page Giter VIP logo

eps2jpeg's Introduction

Eps2Jpeg

Convert Eps files to jpeg with php

Required:

Original source from: https://github.com/czirzow/eps2jpeg

Eps2Jpeg Usage

Start up things:

rock build
rock start

Testing install:

This will test things to ensure everything is setup properly to run things:

http://hostname:8000/test-install/

Testing upload form:

A form to test uploads with:

http://hostname:8000/form/

Converting an eps

Converting an uploaded file:

http://hostname:8000/convert/file/

Converting an raw post of content [not implemented]:

http://hostname:8000/convert/post/

Converting a url [not fully tested]:

http://hostname:8000/convert/url/

Input params for convert [cleanup]

  • source - depending on action: file: a multi-part file uploaded, post: a post var containg content, url: the url to use
  • save_as - filename returned in the headers, defaults to the basename of the original input. (required for convert/post)
  • max_jpeg_size - the max size width or height of jpeg desired, aspect ratio will be kept

[optional]

  • target_format - [default: jpeg] only jpeg supported.
  • eps_width - [default: calculated] a hint to the system about the width of the eps
  • eps_height - [default: calculated] a hint to the system about the height of the eps

note: eps_width and $eps_height are helpful so the convert script does not need to figure out the size.

Response for convert.php

HTTP status codes:

  • 200 - successfull jpg
  • 400 - an error

When the http status code is a 200 (success), a jpeg will follow in the contents. If the form value auto_name was specificed the header with the following headers:

Content-Disposition: attachment; filenme="{$form_upload_basename}.jpg";

if the http status code is a 400 json will be returned, with some information in this format: HTTP/1.1 400 [error_code] error_reason { code: error_code error: error_reason message: reason for this error }

Error Codes

 -2 - simply a bad upload (should not happen)
 -1 - uknown error, it is the default error
  1  - parameter passed issue
  2  - there was a problem initializing the paramters
  3  - there was a problem converting the file.

Example Response:

 HTTP/1.1 400 [1] Invalid Parameter
 {
    status: 400,
    code: 1,
    error: "Invalid Parameter",
    message: "eps_width and eps_height must both be passed"
 }

eps2jpeg's People

Contributors

czirzow avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

eps2jpeg's Issues

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.