Skip to content

api photo config set

Alban LEROUX edited this page Oct 3, 2011 · 3 revisions

API

photo.config.set

Update the photo plugin configuration.

require config grant access

Request example

GET http://example.com/api/get/photo.config.set/json/?directory=photos&original=original&resized=resized&thumb=thumb&sizes[resized][type]=fixed&sizes[resized][width]=600&sizes[resized][height]=200&sizes[thumb][type]=square&sizes[thumb][size]=150
{
	"method"  : "photo.config.set",
	"request" : 
	{
		"directory" : "photos",
		"original"  : "original",
		"resized"   : "resized",
		"thumb"     : "thumb",
		"quality"   : "quality",
		"sizes"     : 
		{
			"resized" : 
			{ 
				"type"   : "fixed", 
				"width"  : 600, 
				"height" : 200 
			},
			"thumb" : 
			{ 
				"type" : "square", 
				"size" : 150 
			}
		}
	}
}
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<xml>
	<method>photo.config.set</method>
	<request>
		<directory>photos</directory>
		<original>original</original>
		<resized>resized</resized>
		<thumb>thumb</thumb>
		<quality>90</quality>
		<sizes>
			<resized>
				<type>fixed</type>
				<width>600</width>
				<height>200</height>
			</resized>
			<thumb>
				<type>square</type>
				<size>150</size>
			</thumb>
		</sizes>
	</request>
</xml>

Response example

{
	"status"   : "valid",
	"response" : { "message" : "configuration updated" }
}
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<xml>
	<status>valid</status>
	<response>
		<message>configuration updated</message>
	</response>
</xml>

Arguments

  • [directory]: is the main folder contains all photos
  • [original]: is a sub folder of directory contains all original photos.
  • [resized]: is a sub folder of directory contains all medium size photos.
  • [thumb]: is a sub folder of directory contains all thumb size photos.
  • [sizes]: photo sizes
    • [resized]: the resized size
      • [type]: larger-border | fixed-width | fixed-height | fixed | square
      • [size]: the photo size, use this option just with type != fixed
      • [width]: the photo width size, use this option just with type = fixed
      • [height]: the photo height size, use this option just with type = fixed
    • [thumb]: the thumb size
      • [type]: larger-border | fixed-width | fixed-height | fixed | square
      • [size]: the photo size, use this option just with type != fixed
      • [width]: the photo width size, use this option just with type = fixed
      • [height]: the photo height size, use this option just with type = fixed

NOTE: All argument node is optional

Clone this wiki locally