Browse Source

Multires thumbnail must be a power of two.

WebGL 1 doesn't support REPEAT clamp mode for non-power-of-two images, which
is needed to avoid some rendering artifacts for small previews.
pull/1015/head
Matthew Petroff 3 years ago
parent
commit
f9ccdda5bd
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      utils/multires/generate.py

+ 7
- 1
utils/multires/generate.py View File

@@ -146,7 +146,7 @@ parser.add_argument('-q', '--quality', dest='quality', default=75, type=int,
parser.add_argument('--png', action='store_true',
help='output PNG tiles instead of JPEG tiles')
parser.add_argument('--thumbnailsize', dest='thumbnailSize', default=0, type=int,
help='width of equirectangular thumbnail preview (defaults to no thumbnail; >512 not recommended)')
help='width of equirectangular thumbnail preview (defaults to no thumbnail; must be power of two; >512 not recommended)')
parser.add_argument('-n', '--nona', default=nona, required=nona is None,
metavar='EXECUTABLE',
help='location of the nona executable to use')
@@ -157,6 +157,12 @@ parser.add_argument('-d', '--debug', action='store_true',
args = parser.parse_args()


# Check argument
if args.thumbnailSize > 0:
if args.thumbnailSize & (args.thumbnailSize - 1) != 0:
print('Thumbnail size, if specified, must be a power of two')
sys.exit(1)

# Create output directory
if os.path.exists(args.output):
print('Output directory "' + args.output + '" already exists')


Loading…
Cancel
Save