浏览代码

ImageUtils.getDataURL: Added warning when saving image as jpg. (#21386)

* ImageUtils: Added warning when saving image as jpg.

* Fixed trailing spaces
Mr.doob 4 年之前
父节点
当前提交
78c2e35e2f
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/extras/ImageUtils.js

+ 2 - 0
src/extras/ImageUtils.js

@@ -47,6 +47,8 @@ const ImageUtils = {
 
 		if ( canvas.width > 2048 || canvas.height > 2048 ) {
 
+			console.warn( 'THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons', image );
+
 			return canvas.toDataURL( 'image/jpeg', 0.6 );
 
 		} else {