<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<?pixaria pixieversion="1.0.0" scriptversion="1.1" ?>

<PixieDefinition>

	<PixieName>Random Image</PixieName>
	
	<PixieVersion>2.0.1</PixieVersion>
	
	<PixieUniqueID>AD4</PixieUniqueID>
	
	<PixieDescription>This Pixie allows you to show a randomly selected image from your library and has options to specify the size, aspect ratio and gallery that the image comes from.</PixieDescription>
	
	<PixieNotice>Random image can only be loaded once per template.  If you call it more than once, it will only load the previous random image a second time. If you're displaying a comping size image, watermark and output formatting settings will be respected.</PixieNotice>
	
	<PixieExamples>
		
		<PixieExample>
		
			<PixieExampleDescription>Load a small (80 x 80 pixel) image with a portrait aspect ratio while respecting image access permissions.</PixieExampleDescription>
		
			<PixieExampleCode>{load_pixie name="random_image" options="true:portrait:small"}</PixieExampleCode>
		
		</PixieExample>
		
		<PixieExample>
		
			<PixieExampleDescription>Load a comping image with a square aspect ratio from the gallery with a database gallery_id of 12 while respecting image access permissions.</PixieExampleDescription>
		
			<PixieExampleCode>{load_pixie name="random_image" options="true:square:comp:12"}</PixieExampleCode>
		
		</PixieExample>
		
		<PixieExample>
		
			<PixieExampleDescription>Load a comping image with any aspect ratio and ignore image access permissions.</PixieExampleDescription>
		
			<PixieExampleCode>{load_pixie name="random_image" options="false::comp"}</PixieExampleCode>
		
		</PixieExample>
		
	</PixieExamples>
	
	<PixieOptions>
	
		<Option>
		
			<OptionName>Access permissions</OptionName>
			
			<OptionDescription>Tell this Pixie whether or not to respect access restrictions on images</OptionDescription>
			
			<OptionType>Boolean</OptionType>
			
			<OptionNotes>Required</OptionNotes>
			
			<OptionValues>
			
				<OptionAllowedValue>true</OptionAllowedValue>
				
				<OptionAllowedValue>false</OptionAllowedValue>
				
			</OptionValues>
			
		</Option>
		
		<Option>
		
			<OptionName>Aspect ratio</OptionName>
			
			<OptionDescription>Choose what apsect ratio of image to display</OptionDescription>
			
			<OptionType>String</OptionType>
			
			<OptionNotes>Optional</OptionNotes>
			
			<OptionValues>
			
				<OptionAllowedValue>portrait</OptionAllowedValue>
				
				<OptionAllowedValue>landscape</OptionAllowedValue>
				
				<OptionAllowedValue>square</OptionAllowedValue>
				
			</OptionValues>
			
		</Option>
		
		<Option>
		
			<OptionName>Image size</OptionName>
			
			<OptionDescription>Set the size of image to output</OptionDescription>
			
			<OptionType>String</OptionType>
			
			<OptionNotes>Optional (defaults to comp)</OptionNotes>
			
			<OptionValues>
			
				<OptionAllowedValue>icon</OptionAllowedValue>
				
				<OptionAllowedValue>small</OptionAllowedValue>
				
				<OptionAllowedValue>large</OptionAllowedValue>
				
				<OptionAllowedValue>comp</OptionAllowedValue>
				
			</OptionValues>
			
		</Option>
		
		<Option>
		
			<OptionName>Gallery ID</OptionName>
			
			<OptionDescription>Select images from the gallery with this ID</OptionDescription>
			
			<OptionType>Integer</OptionType>
			
			<OptionNotes>Optional (defaults to all galleries)</OptionNotes>
			
			<OptionValues>
			
				<OptionAllowedValue>Gallery ID</OptionAllowedValue>
				
			</OptionValues>
			
		</Option>
		
	</PixieOptions>
	
</PixieDefinition>

