Skip to content

Commit

Permalink
v4.7.0-beta.1 [ci-build]
Browse files Browse the repository at this point in the history
Implement max texture size error
  • Loading branch information
JannisX11 committed Apr 8, 2023
1 parent 07f03f5 commit fa15b4b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions js/texturing/textures.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ class Texture {
let dimensions_changed = scope.width !== img.naturalWidth || scope.height !== img.naturalHeight;
scope.width = img.naturalWidth;
scope.height = img.naturalHeight;
if (img.naturalWidth > 16384 || img.naturalHeight > 16384) {
scope.error = 2;
}
scope.currentFrame = Math.min(scope.currentFrame, (scope.frameCount||1)-1)

if (scope.isDefault) {
Expand Down Expand Up @@ -279,6 +282,7 @@ class Texture {
switch (this.error) {
case 0: return ''; break;
case 1: return tl('texture.error.file'); break;
case 2: return tl('texture.error.too_large', ['16384']); break;
//case 1: return tl('texture.error.invalid'); break;
//case 2: return tl('texture.error.ratio'); break;
case 3: return tl('texture.error.parent'); break;
Expand Down
2 changes: 1 addition & 1 deletion js/webpack/bundle.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1857,8 +1857,7 @@
"switches.autouv": "Auto UV",

"texture.error.file": "File not found",
"texture.error.invalid": "Invalid file",
"texture.error.ratio": "Invalid aspect ratio",
"texture.error.too_large": "Resolution exceeds the maximum of %0",
"texture.error.parent": "Texture file provided by parent model",

"reference_image.position": "Position",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Blockbench",
"description": "Low-poly modeling and animation software",
"version": "4.7.0-beta.1",
"version": "4.7.0-beta.2",
"license": "GPL-3.0-or-later",
"author": {
"name": "JannisX11",
Expand Down

0 comments on commit fa15b4b

Please sign in to comment.