mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-30 19:00:09 +00:00 
			
		
		
		
	added --tag option to build cache, now tags new images by default...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									04be56f096
								
							
						
					
					
						commit
						f48102034b
					
				| @ -2,7 +2,7 @@ | |||||||
| #======================================================================= | #======================================================================= | ||||||
| 
 | 
 | ||||||
| __version__ = '''0.0.01''' | __version__ = '''0.0.01''' | ||||||
| __sub_version__ = '''20131026130132''' | __sub_version__ = '''20131219053320''' | ||||||
| __copyright__ = '''(c) Alex A. Naanou 2011''' | __copyright__ = '''(c) Alex A. Naanou 2011''' | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -50,6 +50,9 @@ CONFIG = { | |||||||
| 	'gid-source': 'original', | 	'gid-source': 'original', | ||||||
| 
 | 
 | ||||||
| 	'base-ribbon': 0, | 	'base-ribbon': 0, | ||||||
|  | 	'tags': [ | ||||||
|  | 		'unsorted', | ||||||
|  | 	], | ||||||
| 
 | 
 | ||||||
| 	'cache-image-name': '%(guid)s - %(name)s', | 	'cache-image-name': '%(guid)s - %(name)s', | ||||||
| 
 | 
 | ||||||
| @ -498,6 +501,7 @@ def build_images(path, config=CONFIG, gid_generator=hash_gid, dry_run=False, ver | |||||||
| 			'name': name, | 			'name': name, | ||||||
| 			'type': 'image', | 			'type': 'image', | ||||||
| 			'state': 'single', | 			'state': 'single', | ||||||
|  | 			'tags': config.get('tags', []), | ||||||
| 			'orientation': { | 			'orientation': { | ||||||
| 					0: 0, | 					0: 0, | ||||||
| 					1: 0, | 					1: 0, | ||||||
| @ -647,7 +651,8 @@ def build_data(images, path, config=CONFIG): | |||||||
| # High-level API... | # High-level API... | ||||||
| #---------------------------------------------------------build_cache--- | #---------------------------------------------------------build_cache--- | ||||||
| def build_cache(path, config=CONFIG, gid_generator=hash_gid,  | def build_cache(path, config=CONFIG, gid_generator=hash_gid,  | ||||||
| 		report_progress=report_progress, dry_run=False, images_only=False, verbosity=0): | 		report_progress=report_progress, dry_run=False, images_only=False,  | ||||||
|  | 		verbosity=0): | ||||||
| 	''' | 	''' | ||||||
| 
 | 
 | ||||||
| 	NOTE: when updating existing cache, this will re-sort the images. | 	NOTE: when updating existing cache, this will re-sort the images. | ||||||
| @ -832,6 +837,16 @@ def handle_commandline(): | |||||||
| 	output_configuration.add_option('--base-ribbon', | 	output_configuration.add_option('--base-ribbon', | ||||||
| 						default=CONFIG['base-ribbon'], | 						default=CONFIG['base-ribbon'], | ||||||
| 						help='Base ribbon number (default: "%default").') | 						help='Base ribbon number (default: "%default").') | ||||||
|  | 	output_configuration.add_option('-t', '--tag', | ||||||
|  | 						action='append', | ||||||
|  | 						default=CONFIG['tags'][:], | ||||||
|  | 						help='add tag to each image (default: %default).', | ||||||
|  | 						metavar='TAG') | ||||||
|  | 	output_configuration.add_option('--notag', | ||||||
|  | 						action='append', | ||||||
|  | 						default=[], | ||||||
|  | 						help='do not add tag to images (default: %default).', | ||||||
|  | 						metavar='TAG') | ||||||
| 	output_configuration.add_option('--force-ascii',  | 	output_configuration.add_option('--force-ascii',  | ||||||
| 						action='store_true', | 						action='store_true', | ||||||
| 						default=False, | 						default=False, | ||||||
| @ -906,6 +921,9 @@ def handle_commandline(): | |||||||
| 			'force-ascii': options.force_ascii, | 			'force-ascii': options.force_ascii, | ||||||
| 			}) | 			}) | ||||||
| 
 | 
 | ||||||
|  | 	# build the tags... | ||||||
|  | 	tags = config['tags'] = list(set(options.tag + config['tags']).difference(options.notag)) | ||||||
|  | 
 | ||||||
| 	# a value from 0 through 2... | 	# a value from 0 through 2... | ||||||
| 	verbosity = options.verbosity | 	verbosity = options.verbosity | ||||||
| 	# bool... | 	# bool... | ||||||
|  | |||||||
							
								
								
									
										28
									
								
								ui/data.js
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								ui/data.js
									
									
									
									
									
								
							| @ -13,12 +13,12 @@ var CONFIG = { | |||||||
| 
 | 
 | ||||||
| 	// Loader configuration...
 | 	// Loader configuration...
 | ||||||
| 	//
 | 	//
 | ||||||
| 	//		load_screens	
 | 	//						load_screens	
 | ||||||
| 	// 	|<---------------------->|
 | 	// 					|<---------------------->|
 | ||||||
| 	// 	ooooooooooooXooooooooooooo
 | 	// 		ribbon:		ooooooooooooXooooooooooooo
 | ||||||
| 	// 					 |<----->|<------------>|
 | 	// 									 |<----->|<------------>|
 | ||||||
| 	// 						^	   roll_frame			  
 | 	// 										^	   roll_frame			  
 | ||||||
| 	// 		load_threshold -+
 | 	// 						load_threshold -+
 | ||||||
| 	//
 | 	//
 | ||||||
| 	// number of screens to keep loaded...
 | 	// number of screens to keep loaded...
 | ||||||
| 	//
 | 	//
 | ||||||
| @ -33,14 +33,28 @@ var CONFIG = { | |||||||
| 	// A threshold after which the image block ratio will be changed form 
 | 	// A threshold after which the image block ratio will be changed form 
 | ||||||
| 	// 1x1 to 'fit-viewer' in single image mode...
 | 	// 1x1 to 'fit-viewer' in single image mode...
 | ||||||
| 	//
 | 	//
 | ||||||
| 	// this can be:
 | 	// This can be:
 | ||||||
| 	// 	- null					: feature disabled
 | 	// 	- null					: feature disabled
 | ||||||
| 	// 	- number				: discrete threshold
 | 	// 	- number				: discrete threshold
 | ||||||
| 	// 	- array of 2 numbers	: two thresholds, in between the 
 | 	// 	- array of 2 numbers	: two thresholds, in between the 
 | ||||||
| 	// 								image proportions will transition 
 | 	// 								image proportions will transition 
 | ||||||
| 	// 								gradually form square to screen
 | 	// 								gradually form square to screen
 | ||||||
| 	//
 | 	//
 | ||||||
|  | 	// When using array threshold, the gap between top and bottom must 
 | ||||||
|  | 	// be at least a couple of zoom_step_scale's.
 | ||||||
|  | 	//
 | ||||||
| 	// NOTE: the array format, threshold order is not important.
 | 	// NOTE: the array format, threshold order is not important.
 | ||||||
|  | 	// NOTE: setting this to an integer may have a side-effect of making
 | ||||||
|  | 	// 		zooming of images win opposite proportions to the viewer 
 | ||||||
|  | 	// 		behave oddly on the threshold...
 | ||||||
|  | 	// 		...usually looking line the image getting a bit smaller for
 | ||||||
|  | 	// 		a step while zooming in, or the opposite, this is normal.
 | ||||||
|  | 	// NOTE: array of two integers produces a barely noticeable 
 | ||||||
|  | 	// 		side-effect of zooming being a bit uneven between the 
 | ||||||
|  | 	// 		threshold values.
 | ||||||
|  | 	// 		this is due to the same reasons as for "jumping zoom" 
 | ||||||
|  | 	// 		described above, and will be less noticeable the larger the
 | ||||||
|  | 	// 		gap between thresholds.
 | ||||||
| 	proportions_ratio_threshold: [  | 	proportions_ratio_threshold: [  | ||||||
| 		1.2,  | 		1.2,  | ||||||
| 		2.5  | 		2.5  | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user