{ "info": { "author": "Wu Zhe", "author_email": "wu@madk.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet", "Topic :: Multimedia :: Graphics :: Graphics Conversion", "Topic :: Utilities" ], "description": "===================\nThe Imgserve Server\n===================\n\n.. contents:: **Table of Contents**\n\nIntroduction\n============\n\nImgserve is a python image processing server designed to provide image\nprocessing service, currently supporting only image rescaling, and svg\nrasterization. It can utilize modern multicore CPU to achieve higher\nthroughput and possibly better performance.\n\nUser applications send requests in JSON format over HTTP to a running\nimgserve, which downloads source image from URL specified in the\nrequest object, performs the requested operation on the source image,\nuploads the result image to the specified destination.\n\nFeatures\n========\n\n* Using a multi-process architecture\n\n* Communication with user applications using JSON object over HTTP\n\n* Image processing operations currently supported: rescaling, svg\n rasterization\n\n* Image downloading with FTP, FTPS, HTTP, HTTPS and local FILE\n\n* Image uploading with HTTP POST, HTTP PUT (not implemented yet), FTP\n and local FILE\n\nInstalling\n==========\n\nPre-requisit:\n-------------\n\n* Python >= 2.5, (in Debian, ``sudo aptitude install python``)\n\n* Multiprocessing, (Only if python version <= 2.5. In Debian, ``sudo\n aptitude install python-multiprocessing``)\n\n* PIL, (in Debian, ``sudo aptitude install python-imaging``)\n\n* python-rsvg, (in Debian, ``sudo aptitude install python-rsvg``)\n\n* python-pycurl, (in Debian, ``sudo aptitude install python-pycurl``)\n\nTo run tests, additional packages are required:\n\n* nose, (in Debian, ``sudo easy_install python-nose``)\n\n* pyftpdlib, (in Debian, ``sudo easy_install pyftpdlib``)\n\nInstall\n-------\n\n``sudo easy_install imgserve``\n\nUsage & Server API\n==================\n\nStart imgserve daemon with ``imgserve start``, you can run imgserve\nunder root but root privilege is not required, the only difference of\nrunning imgserve with root user or a non-root user is where log and\npid files are placed:\n\n* When imgserve is run with root user, log files are put into\n ``/var/log/imgserve`` directory, pid file is put into ``/var/run/``\n directory.\n\n* When imgserve is run with a non-root user, log and pid files are put\n into ``~/.imgserve`` directory.\n\nYou can tell imgserve to which IP interface to bind and on which port\nto listen using ``imgserve start -host IP_ADDRESS -port PORT``, note\nlow number ports require root privilege to use. If host and port are\nnot specified, their default values are used, ``0.0.0.0`` (all IP\ninterfaces on the host) for host and 8602 for port.\n\nWhen imgserve is running, we can send it requests, let's see an\nexample of a JSON request:\n\n::\n\n {\n \"operationType\": \"resize\",\n \"srcURL\": \"http://upload.wikimedia.org/wikipedia/en/7/70/Ex.png\",\n \"dstURL\": \"ftp://upload.wikimedia.org/wikipedia/en/7/70/{$width}-{$basename}.{$ext}\",\n \"args\": {\n \"width\": 200,\n \"height\": 120\n }\n }\n\nThis request instructs imgserve to download the image file from\n``srcURL``, resize it to a 200 x 120 thumbnail cropping the sides (top\nand bottom, or left and right) if necessary, and upload the thumbnail\nimage to ``dstURL`` under a new file name which can be set dynamically\nwith special tags in ``dstURL`` value. Here are some rules that\nshould be followed for the request to be valid:\n\n* Must be valid JSON object.\n\n* Four keys (``operationType``, ``args``, ``srcURL``, ``dstURL``) are\n required.\n\n* ``operationType`` currently can only be ``resize`` or ``rasterize``.\n\n* ``args`` value must be a collection of key/value pairs (aka JSON\n object), passing extra arguments to the operation.\n\n* ``srcURL`` is a valid URL of an image, using whatever protocol\n imgserve supports;\n\n* ``dstURL`` is a URL using whatever protocol imgserve supports along\n with file name of result image.\n\n - The value of ``dstURL`` can contain following special tags that\n will be substituted with real values by imgserve, the result\n string will be the final file name for the result image file that\n is uploaded to the destination.\n\n + ``{$width}`` is replaced with the width of the result image.\n\n + ``{$height}`` is replaced with the height of the result image.\n\n + ``{$basename}`` is replaced with the basename of the original\n file name from ``srcURL``.\n\n + ``{$extension}`` is replaced with the extension name of the\n original file name from ``srcURL``.\n\n - ``dstURL`` looks like a normal URL for FTP and local FILE, but not\n for HTTP POST, because besides a normal HTML page on which a\n upload form resides imgserve has to know the field name of the\n HTML upload form so that imgserve can upload the result image file\n with that specific field.\n\n A new syntax of ``dstURL`` is invented for HTTP POST: ``dstURL``\n is the result of concatenation of the URL of HTML page on which an\n upload form resides, a colon ``:`` and the result image file name\n used when uploading (can also contain special tags that will be\n substituded with real values), the field name of the upload form\n to which the result file is uploaded is specified in ``args`` with\n a new key/value pair, 'field_name' is used as the key name. Let's\n see an example:\n\n ::\n\n {\n \"operationType\": \"resize\",\n \"srcURL\": \"http://upload.wikimedia.org/wikipedia/en/7/70/Ex.png\",\n \"dstURL\": \"http://example.com/upload.html:{$width}-{$basename}.{$ext}\",\n \"args\": {\n \"width\": 200,\n \"height\": 120,\n \"field_name\": 'image_file'\n }\n }\n\n This request instructs imgserve to download an image from\n ``upload.wikimedia.org``, resize it to 200 x 120, rename the\n resized image file to ``200-Ex.png``, and upload ``200-Ex.png`` to\n a remote web site using an upload form on page\n ``http://example.com/upload.html``, the field name used for file\n uploading is ``image_file``.\n\nA reply JSON object is replied as soon as a quick validation on the\nrequest JSON object has been performed. In the process of validation,\na placeholder image that has the same dimenstion with the result image\nis produced and uploaded to the destination URL.\n\nIf the request passes the validation process, a JSON object:\n\n::\n\n {'dstURL': }\n\nis returned, otherwise either\n\n::\n\n {'msg': 'request parse error'}\n\nis returned if the request sent is not a valid JSON object or\n\n::\n\n {'msg', 'request invalid', 'code': }\n\nis returned if the request is JSON syntax correct, but some other\nthings go wrong.\n\nAfter the reply JSON object is returned, imgserve would start the real\nimage processing work and uploads the result image to ``dstURL``,\nsilently overwriting the placeholder file previously uploaded.\n\nContact\n=======\n\nemail: wu at madk.org", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/pypi/imgserve", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/wuzhe/imgserve", "keywords": "image-processing daemon networking imgserve", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "imgserve", "package_url": "https://pypi.org/project/imgserve/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/imgserve/", "project_urls": { "Download": "http://pypi.python.org/pypi/imgserve", "Homepage": "http://github.com/wuzhe/imgserve" }, "release_url": "https://pypi.org/project/imgserve/0.2/", "requires_dist": null, "requires_python": null, "summary": "Imgserve is a daemon program to provide common image processing service", "version": "0.2" }, "last_serial": 793229, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "41878351a712cc26eb35c94f5b3d27fd", "sha256": "5a1394112b8f9780d599f9f3a100fe34f5fc92b4cc3a9a2ff28d8e9a18850e60" }, "downloads": -1, "filename": "imgserve-0.1-py2.5.egg", "has_sig": false, "md5_digest": "41878351a712cc26eb35c94f5b3d27fd", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 244618, "upload_time": "2009-08-09T03:21:21", "url": "https://files.pythonhosted.org/packages/ca/8c/088b9330c283802dd2e50dcdd38b3999fda7967832320e672b844644baaa/imgserve-0.1-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "2889531b56b397a5a5bda04b3f072581", "sha256": "494630f7318ce4b30c64b31ce9184efbcc028653a6cb210d57abdd6d0b5e26fc" }, "downloads": -1, "filename": "imgserve-0.1.tar.gz", "has_sig": false, "md5_digest": "2889531b56b397a5a5bda04b3f072581", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1775620, "upload_time": "2009-08-09T03:21:18", "url": "https://files.pythonhosted.org/packages/f5/3d/97773bafb255a93dbeea1c5b19611982b0b6426ce147180ebcaa5f6b3f43/imgserve-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "a3b5396d34ca0573d6547b9e7c951bf0", "sha256": "39add86e917255116ae5fea842fe35d8c3748797191e586b8a0b685fb81a91c2" }, "downloads": -1, "filename": "imgserve-0.2-py2.5.egg", "has_sig": false, "md5_digest": "a3b5396d34ca0573d6547b9e7c951bf0", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 245150, "upload_time": "2009-08-22T16:09:00", "url": "https://files.pythonhosted.org/packages/24/76/a6fc2992501552e348b71032c6e4c400e867a039fd0ed3d06ec83ab70eb7/imgserve-0.2-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "e87a12cdfe6131e45dd40e0e4654e0db", "sha256": "964052df89ef9ce12c5784e76036844b26b26203832aa90ec7f999b7518c4b25" }, "downloads": -1, "filename": "imgserve-0.2.tar.gz", "has_sig": false, "md5_digest": "e87a12cdfe6131e45dd40e0e4654e0db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1016761, "upload_time": "2009-08-22T16:08:56", "url": "https://files.pythonhosted.org/packages/d9/40/71acda2bfc74abef358c8cdc0c0c66e8af083a735b91f0c442f48537845d/imgserve-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a3b5396d34ca0573d6547b9e7c951bf0", "sha256": "39add86e917255116ae5fea842fe35d8c3748797191e586b8a0b685fb81a91c2" }, "downloads": -1, "filename": "imgserve-0.2-py2.5.egg", "has_sig": false, "md5_digest": "a3b5396d34ca0573d6547b9e7c951bf0", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 245150, "upload_time": "2009-08-22T16:09:00", "url": "https://files.pythonhosted.org/packages/24/76/a6fc2992501552e348b71032c6e4c400e867a039fd0ed3d06ec83ab70eb7/imgserve-0.2-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "e87a12cdfe6131e45dd40e0e4654e0db", "sha256": "964052df89ef9ce12c5784e76036844b26b26203832aa90ec7f999b7518c4b25" }, "downloads": -1, "filename": "imgserve-0.2.tar.gz", "has_sig": false, "md5_digest": "e87a12cdfe6131e45dd40e0e4654e0db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1016761, "upload_time": "2009-08-22T16:08:56", "url": "https://files.pythonhosted.org/packages/d9/40/71acda2bfc74abef358c8cdc0c0c66e8af083a735b91f0c442f48537845d/imgserve-0.2.tar.gz" } ] }