Fixed the satellite image scaling
This commit is contained in:
parent
50e7ca7e25
commit
b26ccbb154
|
@ -108,7 +108,11 @@ def main():
|
||||||
sat_img = Image.new("RGBA", sat_img_aplha.size, (255, 255, 255, 255))
|
sat_img = Image.new("RGBA", sat_img_aplha.size, (255, 255, 255, 255))
|
||||||
sat_img.paste(sat_img_aplha, mask=alpha_chan)
|
sat_img.paste(sat_img_aplha, mask=alpha_chan)
|
||||||
|
|
||||||
sat_img = scale_to_width(sat_img, 500)
|
sat_img_width, sat_img_height = sat_img.size
|
||||||
|
if sat_img_width > sat_img_height:
|
||||||
|
sat_img = scale_to_width(sat_img, 500)
|
||||||
|
else:
|
||||||
|
sat_img = scale_to_height(sat_img, 500)
|
||||||
|
|
||||||
img = Image.new('RGBA', (1280, 1024))
|
img = Image.new('RGBA', (1280, 1024))
|
||||||
draw = ImageDraw.Draw(img)
|
draw = ImageDraw.Draw(img)
|
||||||
|
@ -127,7 +131,7 @@ def main():
|
||||||
img.paste(waterfall, (0, 0))
|
img.paste(waterfall, (0, 0))
|
||||||
img.paste(logo, (water_width + 100, 20))
|
img.paste(logo, (water_width + 100, 20))
|
||||||
if sat_img != None:
|
if sat_img != None:
|
||||||
img.paste(sat_img, (water_width + 100, 500))
|
img.paste(sat_img, (water_width + 100, 480))
|
||||||
|
|
||||||
font = ImageFont.truetype("Montserrat-Regular.otf", FONT_SIZE_SMALL)
|
font = ImageFont.truetype("Montserrat-Regular.otf", FONT_SIZE_SMALL)
|
||||||
draw.text((950, 1000), "Geocoding by Nominatim/OSM", TEXT_COLOR, font=font)
|
draw.text((950, 1000), "Geocoding by Nominatim/OSM", TEXT_COLOR, font=font)
|
||||||
|
|
Loading…
Reference in New Issue