- #ifdef ENABLE_ERROR_MESSAGES
- ERROR("Found uncompressed resource with original size "
- "not the same as compressed size");
- ERROR("The lookup table entry for the resource is as follows:");
- print_lookup_table_entry(cur_entry, stderr);
- #endif
- ret = WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY;
- goto out_free_cur_entry;
+ if (wimlib_print_errors) {
+ WARNING("Found uncompressed resource with "
+ "original size (%"PRIu64") not the same "
+ "as compressed size (%"PRIu64")",
+ cur_entry->resource_entry.original_size,
+ cur_entry->resource_entry.size);
+ if (cur_entry->resource_entry.original_size) {
+ WARNING("Overriding compressed size with original size.");
+ cur_entry->resource_entry.size =
+ cur_entry->resource_entry.original_size;
+ } else {
+ WARNING("Overriding original size with compressed size");
+ cur_entry->resource_entry.original_size =
+ cur_entry->resource_entry.size;
+ }
+ }