Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files getting deleted if compression fails #116

Closed
Giorgio-Germani opened this issue May 6, 2022 · 7 comments
Closed

Files getting deleted if compression fails #116

Giorgio-Germani opened this issue May 6, 2022 · 7 comments
Assignees
Labels

Comments

@Giorgio-Germani
Copy link

Giorgio-Germani commented May 6, 2022

Describe the bug
The Software deletes images, when compression fails.

Software version
Caesium Image Compressor 2.0.0 rc1

Operating System information
WIN 11

To Reproduce
Steps to reproduce the behavior:
Compress attached files with Caesium 2.0.0. RC1

Expected behavior
Failed compression should be listed, but original file should remain in folder.

Screenshots
image

Application Log
If you can, please provide your application log. The location of the file depends on your platform, but they usually are:

[2022-05-06 12:01:29.106][W] QPainter::restore: Unbalanced save/restore
[2022-05-06 12:01:29.107][W] QPainter::restore: Unbalanced save/restore
[2022-05-06 12:01:29.264][I] Usage report sent successfully
[2022-05-06 12:01:31.260][W] QPainter::restore: Unbalanced save/restore
[2022-05-06 12:01:31.261][W] QPainter::restore: Unbalanced save/restore
[2022-05-06 12:01:33.484][W] QPainter::restore: Unbalanced save/restore
[2022-05-06 12:01:33.484][W] QPainter::restore: Unbalanced save/restore
[2022-05-06 12:01:36.056][W] QPainter::restore: Unbalanced save/restore
[2022-05-06 12:01:36.056][W] QPainter::restore: Unbalanced save/restore
[2022-05-06 12:01:36.193][W] QPainter::restore: Unbalanced save/restore
[2022-05-06 12:01:36.193][W] QPainter::restore: Unbalanced save/restore
[2022-05-06 12:01:39.478][W] QPainter::restore: Unbalanced save/restore
[2022-05-06 12:01:39.479][W] QPainter::restore: Unbalanced save/restore
[2022-05-06 12:01:39.487][C] Failed to copy from "D:/Georg/Pictures/Art/tatoos/11_360x500.jpg" to "D:/Georg/Pictures/Art/tatoos/11_360x500.jpg" (:0, )
[2022-05-06 12:01:39.498][C] Failed to copy from "D:/Georg/Pictures/Art/tatoos/10_571x500.jpg" to "D:/Georg/Pictures/Art/tatoos/10_571x500.jpg" (:0, )
[2022-05-06 12:01:39.525][C] Failed to copy from "D:/Georg/Pictures/Art/tatoos/12_360x500.jpg" to "D:/Georg/Pictures/Art/tatoos/12_360x500.jpg" (:0, )
[2022-05-06 12:01:39.527][C] Failed to copy from "D:/Georg/Pictures/Art/sketches/imsedfhsrgtjg.jpg" to "D:/Georg/Pictures/Art/sketches/imsedfhsrgtjg.jpg" (:0, )
[2022-05-06 12:01:39.537][C] Failed to copy from "D:/Georg/Pictures/Art/sketches/im4g.jpg" to "D:/Georg/Pictures/Art/sketches/im4g.jpg" (:0, )
[2022-05-06 12:01:39.538][C] Failed to copy from "D:/Georg/Pictures/Art/tatoos/13_360x500.jpg" to "D:/Georg/Pictures/Art/tatoos/13_360x500.jpg" (:0, )
[2022-05-06 12:01:39.570][C] Failed to copy from "D:/Georg/Pictures/Art/tatoos/5_167x500.jpg" to "D:/Georg/Pictures/Art/tatoos/5_167x500.jpg" (:0, )
[2022-05-06 12:01:39.571][C] Failed to copy from "D:/Georg/Pictures/Art/tatoos/4_263x500.jpg" to "D:/Georg/Pictures/Art/tatoos/4_263x500.jpg" (:0, )
[2022-05-06 12:01:39.613][C] Failed to copy from "D:/Georg/Pictures/Art/tatoos/8_585x500.jpg" to "D:/Georg/Pictures/Art/tatoos/8_585x500.jpg" (:0, )
[2022-05-06 12:01:39.618][C] Failed to copy from "D:/Georg/Pictures/Art/sketches/imwg.jpg" to "D:/Georg/Pictures/Art/sketches/imwg.jpg" (:0, )
[2022-05-06 12:01:39.623][I] Compression canceled by user.
[2022-05-06 12:01:39.624][I] Compression ended successfully.
Total images: 17
Uncompressed size: "396.42 KB"
Compressed size: "394.90 KB"
Elapsed time: 179 ms

Additional context
I attached the restored original files for testing.
tatoos.zip

@Lymphatus
Copy link
Owner

Seems like you're trying to compress images in place, right? Caesium creates a temp file and tries to overwrite the original, but the copy is failing. I'll investigate, thanks!

@Giorgio-Germani
Copy link
Author

Yes indeed. I just want to overwrite the original ones.

@IlluminatiWave
Copy link

I just lost more than 10,000 images because of this bug. XD

@Lymphatus
Copy link
Owner

Found the reason: if you try to overwrite the original file and the compressed is bigger, the compression fails and the original file gets deleted. I'm going to fix it asap as this is a critical bug.

Lymphatus added a commit that referenced this issue May 9, 2022
@Asgatlat
Copy link
Contributor

could you release the fix ?
this bug is terrible (i know that using a RC is at our own risk)

@Lymphatus
Copy link
Owner

I have a fix on b27a397. I think I can make a rc.2 release in the next couple of days.

@Lymphatus
Copy link
Owner

RC.2 released, should be fixed - make a backup save just to be extra sure before giving a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants