mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 06:26:42 +01:00
Fix force image depth conversion for index-based png.
This commit is contained in:
parent
cb7dce84c0
commit
65755f4cf8
3 changed files with 8 additions and 8 deletions
|
@ -50,7 +50,7 @@ function LOAD_PATH(path, readonly = false, safe_mode = false) {
|
|||
if(_PROJECT == noone) {
|
||||
PROJECTS = [ PROJECT ];
|
||||
|
||||
} else if(!_rep && _PROJECT.path == "" && !_PROJECT.modified) {
|
||||
} else if(!_rep && ((_PROJECT.path == "" || _PROJECT.readonly) && !_PROJECT.modified)) {
|
||||
var ind = array_find(PROJECTS, _PROJECT);
|
||||
if(ind == -1) ind = 0;
|
||||
PROJECTS[ind] = PROJECT;
|
||||
|
|
|
@ -83,16 +83,16 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
array_push(attributeEditors, [ "File Watcher", function() { return attributes.file_checker; },
|
||||
new checkBox(function() { attributes.file_checker = !attributes.file_checker; }) ]);
|
||||
|
||||
on_drop_file = function(path) {
|
||||
if(directory_exists(path)) {
|
||||
on_drop_file = function(_path) {
|
||||
if(directory_exists(_path)) {
|
||||
with(dialogCall(o_dialog_drag_folder, WIN_W / 2, WIN_H / 2)) {
|
||||
dir_paths = path;
|
||||
dir_paths = _path;
|
||||
target = other;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var paths = paths_to_array_ext(path);
|
||||
var paths = paths_to_array_ext(_path);
|
||||
|
||||
inputs[0].setValue(paths);
|
||||
if(updatePaths(paths)) {
|
||||
|
@ -128,7 +128,7 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
case ".png" :
|
||||
case ".jpg" :
|
||||
case ".jpeg" :
|
||||
var _real_path = sprite_path_check_depth(path);
|
||||
var _real_path = sprite_path_check_depth(_path);
|
||||
var _spr = sprite_add(_real_path, 1, false, false, 0, 0);
|
||||
|
||||
if(_spr == -1) {
|
||||
|
|
|
@ -25,7 +25,7 @@ function sprite_path_check_depth(path, noti = true) {
|
|||
|
||||
var _data = read_png_header(path, noti);
|
||||
if(_data == noone) return path;
|
||||
if(_data.depth == 8) return path;
|
||||
if(_data.depth <= 8) return path;
|
||||
|
||||
if(noti) noti_warning($"{_data.depth} bits image is not supported. Proxy will be used.");
|
||||
|
||||
|
|
Loading…
Reference in a new issue