Fix layering of small gif frames
This commit is contained in:
		
							parent
							
								
									0a91ede86c
								
							
						
					
					
						commit
						d369f10aa5
					
				
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @ -1,4 +1,4 @@ | |||||||
| VERSION = git-20110926 | VERSION = git-20110928 | ||||||
| 
 | 
 | ||||||
| CC      = gcc | CC      = gcc | ||||||
| CFLAGS  = -Wall -pedantic -O2 | CFLAGS  = -Wall -pedantic -O2 | ||||||
|  | |||||||
							
								
								
									
										12
									
								
								image.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								image.c
									
									
									
									
									
								
							| @ -173,6 +173,9 @@ bool img_load_gif(img_t *img, const fileinfo_t *file) { | |||||||
| 					delay = 10 * ((unsigned int) ext[3] << 8 | (unsigned int) ext[2]); | 					delay = 10 * ((unsigned int) ext[3] << 8 | (unsigned int) ext[2]); | ||||||
| 					if (delay) | 					if (delay) | ||||||
| 						delay = MAX(delay, MIN_GIF_DELAY); | 						delay = MAX(delay, MIN_GIF_DELAY); | ||||||
|  | 
 | ||||||
|  | 					/* TODO: handle disposal method, section 23.c.iv of
 | ||||||
|  | 					         http://www.w3.org/Graphics/GIF/spec-gif89a.txt */
 | ||||||
| 				} | 				} | ||||||
| 				ext = NULL; | 				ext = NULL; | ||||||
| 				DGifGetExtensionNext(gif, &ext); | 				DGifGetExtensionNext(gif, &ext); | ||||||
| @ -209,12 +212,9 @@ bool img_load_gif(img_t *img, const fileinfo_t *file) { | |||||||
| 
 | 
 | ||||||
| 			for (i = 0; i < sh; i++) { | 			for (i = 0; i < sh; i++) { | ||||||
| 				for (j = 0; j < sw; j++) { | 				for (j = 0; j < sw; j++) { | ||||||
| 					if (i < y || i >= y + h || j < x || j >= x + w) { | 					if (i < y || i >= y + h || j < x || j >= x + w || | ||||||
| 						if (transp >= 0 && prev_frame) | 					    rows[i-y][j-x] == transp) | ||||||
| 							*ptr = prev_frame[i * sw + j]; | 					{ | ||||||
| 						else |  | ||||||
| 							*ptr = bgpixel; |  | ||||||
| 					} else if (rows[i-y][j-x] == transp) { |  | ||||||
| 						if (prev_frame) | 						if (prev_frame) | ||||||
| 							*ptr = prev_frame[i * sw + j]; | 							*ptr = prev_frame[i * sw + j]; | ||||||
| 						else | 						else | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Bert Münnich
						Bert Münnich