Fix width/height

pull/1582/head
Piero Toffanin 2023-01-11 15:48:37 -05:00
rodzic 15131be6cc
commit 2b2875bec6
1 zmienionych plików z 10 dodań i 3 usunięć

Wyświetl plik

@ -2,8 +2,12 @@ import os
import rasterio
import warnings
import numpy as np
from .imagepacker.utils import AABB
from .imagepacker import pack
try:
from .imagepacker.utils import AABB
from .imagepacker import pack
except ImportError:
from imagepacker.utils import AABB
from imagepacker import pack
warnings.filterwarnings("ignore", category=rasterio.errors.NotGeoreferencedWarning)
@ -139,10 +143,13 @@ def write_obj_changes(obj_file, mtl_file, uv_changes, single_mat, output_dir, _i
f.writelines(out_lines)
def write_output_tex(img, profile, path, _info=print):
_, h, w = img.shape
_, w, h = img.shape
profile['width'] = w
profile['height'] = h
if 'tiled' in profile:
profile['tiled'] = False
_info("Writing %s (%sx%s pixels)" % (path, w, h))
with rasterio.open(path, 'w', **profile) as dst:
for b in range(1, img.shape[0] + 1):