mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-12 03:39:51 +00:00
Add possibility to open broken .ase files on devmode
This commit is contained in:
parent
d00db433fe
commit
e392934afc
@ -524,8 +524,12 @@ static bool ase_file_read_header(FILE* f, ASE_Header* header)
|
||||
|
||||
header->size = fgetl(f);
|
||||
header->magic = fgetw(f);
|
||||
|
||||
// Developers can open any .ase file
|
||||
#if !defined(ENABLE_DEVMODE)
|
||||
if (header->magic != ASE_FILE_MAGIC)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
header->frames = fgetw(f);
|
||||
header->width = fgetw(f);
|
||||
@ -552,6 +556,15 @@ static bool ase_file_read_header(FILE* f, ASE_Header* header)
|
||||
header->pixel_height = 1;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_DEVMODE)
|
||||
// This is useful to read broken .ase files
|
||||
if (header->magic != ASE_FILE_MAGIC) {
|
||||
header->frames = 256; // Frames number might be not enought for some files
|
||||
header->width = 1024; // Size doesn't matter, the sprite can be crop
|
||||
header->height = 1024;
|
||||
}
|
||||
#endif
|
||||
|
||||
fseek(f, header->pos+128, SEEK_SET);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user