mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-30 19:00:09 +00:00 
			
		
		
		
	minor tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									f590f4f54f
								
							
						
					
					
						commit
						d0d07c852e
					
				| @ -21,9 +21,6 @@ exiftool -if '$jpgfromraw' -b -jpgfromraw -w "$PREVIEW_NAME" \ | |||||||
| 	-common_args --ext jpg -r "$ARCHIVE_ROOT" -progress | 	-common_args --ext jpg -r "$ARCHIVE_ROOT" -progress | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| # need to calculate this correctly... |  | ||||||
| FACTOR=4.76 |  | ||||||
| 
 |  | ||||||
| SIZE=900 | SIZE=900 | ||||||
| 
 | 
 | ||||||
| ALGORITHM=bicubic | ALGORITHM=bicubic | ||||||
| @ -32,7 +29,6 @@ COMPRESSION=90 | |||||||
| 
 | 
 | ||||||
| PATH=$PATH:`pwd`/vips-dev-7.32.0/bin/ | PATH=$PATH:`pwd`/vips-dev-7.32.0/bin/ | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| # XXX use find... | # XXX use find... | ||||||
| for f in "${ARCHIVE_ROOT}"/DCIM/hi-res\ \(RAW\)/*jpg ; do | for f in "${ARCHIVE_ROOT}"/DCIM/hi-res\ \(RAW\)/*jpg ; do | ||||||
| 	# create preview dir if it does not already exist... | 	# create preview dir if it does not already exist... | ||||||
| @ -41,20 +37,22 @@ for f in "${ARCHIVE_ROOT}"/DCIM/hi-res\ \(RAW\)/*jpg ; do | |||||||
| 		mkdir -p "$D" | 		mkdir -p "$D" | ||||||
| 	fi | 	fi | ||||||
| 
 | 
 | ||||||
| 	# calculate the factor... | 	# create previews... | ||||||
| 	W=$(vips im_header_string width "$f") | 	if ! [ -e "${f/hi-res\ /preview }" ] ; then | ||||||
| 	H=$(vips im_header_string height "$f") |  | ||||||
| 
 | 
 | ||||||
| 	# NOTE: vips appends \r to these!!! | 		# get source size... | ||||||
|  | 		W=$(vips im_header_int width "$f") | ||||||
|  | 		H=$(vips im_header_int height "$f") | ||||||
|  | 
 | ||||||
|  | 		# NOTE: vips appends nasty unprintable \r's to values, so we need to clean them out... | ||||||
| 		W=${W//[![:digit:]]/} | 		W=${W//[![:digit:]]/} | ||||||
| 		H=${H//[![:digit:]]/} | 		H=${H//[![:digit:]]/} | ||||||
| 
 | 
 | ||||||
|  | 		# calculate the factor... | ||||||
| 		FACTOR=$(echo "scale = 4; if($H > $W) s = $H else s = $W ; s / $SIZE" | bc -l) | 		FACTOR=$(echo "scale = 4; if($H > $W) s = $H else s = $W ; s / $SIZE" | bc -l) | ||||||
| 
 | 
 | ||||||
| 		echo "($FACTOR): ${f/hi-res\ /preview }:${COMPRESSION}" | 		echo "($FACTOR): ${f/hi-res\ /preview }:${COMPRESSION}" | ||||||
| 
 | 
 | ||||||
| 	# create previews... |  | ||||||
| 	if ! [ -e "${f/hi-res\ /preview }" ] ; then |  | ||||||
| 		vips im_shrink "$f" "${f/hi-res\ /preview }:${COMPRESSION}" $FACTOR $FACTOR 2> /dev/null | 		vips im_shrink "$f" "${f/hi-res\ /preview }:${COMPRESSION}" $FACTOR $FACTOR 2> /dev/null | ||||||
| 	fi | 	fi | ||||||
| done | done | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user