mirror of
				https://git.sleeping.town/mirrors/foxy-moxy
				synced 2025-11-03 18:12:17 -08:00 
			
		
		
		
	Make sure it returns the png header.
This commit is contained in:
		
							parent
							
								
									0e2d3258ab
								
							
						
					
					
						commit
						47ff425041
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
					@ -45,6 +45,7 @@ app.get('/', function(req, res) {
 | 
				
			||||||
    var width = 400;
 | 
					    var width = 400;
 | 
				
			||||||
    var seed = uuid();
 | 
					    var seed = uuid();
 | 
				
			||||||
    var canvas = composeImage(width, width, seed);
 | 
					    var canvas = composeImage(width, width, seed);
 | 
				
			||||||
 | 
					    res.type('png');
 | 
				
			||||||
    res.end(canvas.toBuffer(), 'binary');
 | 
					    res.end(canvas.toBuffer(), 'binary');
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -52,6 +53,7 @@ app.get('/:width', function(req, res) {
 | 
				
			||||||
    var width = parseInt(req.params.width) || 400;
 | 
					    var width = parseInt(req.params.width) || 400;
 | 
				
			||||||
    var seed = uuid();
 | 
					    var seed = uuid();
 | 
				
			||||||
    var canvas = composeImage(width, width, seed);
 | 
					    var canvas = composeImage(width, width, seed);
 | 
				
			||||||
 | 
					    res.type('png');
 | 
				
			||||||
    res.end(canvas.toBuffer(), 'binary');
 | 
					    res.end(canvas.toBuffer(), 'binary');
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -59,6 +61,7 @@ app.get('/:width/:seed', function(req, res) {
 | 
				
			||||||
    var width = parseInt(req.params.width) || 400;
 | 
					    var width = parseInt(req.params.width) || 400;
 | 
				
			||||||
    var seed = sanitize(req.params.seed) || uuid();
 | 
					    var seed = sanitize(req.params.seed) || uuid();
 | 
				
			||||||
    var canvas = composeImage(width, width, seed);
 | 
					    var canvas = composeImage(width, width, seed);
 | 
				
			||||||
 | 
					    res.type('png');
 | 
				
			||||||
    res.end(canvas.toBuffer(), 'binary');
 | 
					    res.end(canvas.toBuffer(), 'binary');
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue