You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When saving a file to jclic.zip format by using JClic author, if there's a resource (for example, an image) that's missing, the target jclic.zip file starts being written, but when the resource would be saved, an error appears, writing stops at that point, and the output zip file gets corrupted and can't be opened.
This could happen if for example an image from a usb drive was included, and the drive removed before saving.
It would be good if the behavior was less drastic, because if the user closes Jclic at that point, their work is lost.
The text was updated successfully, but these errors were encountered:
1 - Create a temporary ZIP file 2 - Write the project definition (.jclic file) and needed ingredients (images, sounds...) into this temporary file. 3 - If something goes wrong, catch the exception and notify the user about the error found. The project state remains as "unsaved", and the original file has been not modified. 4 - From here, we assume that everything went well. The temporary ZIP file contains the saved project and is in good condition. 5 - Replace the original project file with the temporary ZIP file. This is done deleting the original file and, then, renaming the temporary.
In some cases, and for unknown reasons, the assertion made in step 4 is not met. Actually, the temporary file is corrupted and no error or exception is thrown by the Java engine. This results in the loss of the original project.
Now, since JClic v0.3.2.0, we perform an additional step:
2b - Open the temporary file, read its the ZIP directory and check for empty or inaccessible files inside it. If something goes wrong, throw an IOException.
Hope this will reduce the risk of producing corrupted files when saving projects. Please notify us if the problem appears again.
The text was updated successfully, but these errors were encountered: