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

Export process corrupts .paa image files #181

Open
OfficialStamper opened this issue Oct 27, 2019 · 7 comments
Open

Export process corrupts .paa image files #181

OfficialStamper opened this issue Oct 27, 2019 · 7 comments
Labels
bug Issues concerning bugs in the plugin with Dev-Build This issue has been resolved in the Dev-Build

Comments

@OfficialStamper
Copy link

OfficialStamper commented Oct 27, 2019

When exporting project to arma folders, any .paa image files copied get corrupted and arma will not load them giving the following errors in .rpt file:

10:55:50 Bad DXT2-5 mipmap size
10:55:50 Size out of range

@Krzmbrzl Krzmbrzl added the bug Issues concerning bugs in the plugin label Oct 27, 2019
@Krzmbrzl
Copy link
Owner

Maybe this has something to do with #146. Could you check whether the .paa files are valid after they have been imported into the workspace (e.g. by manually copying it into a mission folder from there and try to load it in Arma)?

@OfficialStamper
Copy link
Author

OfficialStamper commented Oct 27, 2019

I am trying to @preserve folders containing any image files without success. Can what is the correct syntax?

e.g Folder structure:
\resources\img

@preserve "resource"
or
@preserve "resource\"
or
@preserve "resource\*"

Help! ;)

@OfficialStamper
Copy link
Author

OfficialStamper commented Oct 27, 2019

Maybe this has something to do with #146. Could you check whether the .paa files are valid after they have been imported into the workspace (e.g. by manually copying it into a mission folder from there and try to load it in Arma)?

Yes, the files within the eclipse project are valid. Using Arma 3 Tools | texview2 correctly displays the image. However, any .paa exported via SQDev cannot be viewed using the same method.

After export, my only option is to completely shut down arma (I think it caches the .paa somewhere), manually replace the .paa files outside of eclipse, restart Arma.

n.b. the links in #146 are broken.

@Krzmbrzl
Copy link
Owner

If you want to use regular expressions for the @preserve attribute, you have to prefix the expression:

if (currentValue.startsWith(REGEX_PREFIX)) {
// the value is to be interpreted as a regular expression
// remove the prefix though
currentValue = currentValue.substring(REGEX_PREFIX.length());
} else {
// quote the input as it must not be interpreted as a regular expression
currentValue = Pattern.quote(currentValue);
}

The respective prefix being <RegEx>
public static final String REGEX_PREFIX = "<RegEx>";

If not the name of the folder to be preserved should suffice. Note however that this only prevents the folder from being deleted but not from being overwritten. In order to achieve both, you have to preserve the folder in the target-dir (as you already did) and ignore the folder in the workspace when exporting the project via the @ignore attribute. That should do the trick.

Yes, the files within the eclipse project are valid. Using Arma 3 Tools | texview2 correctly displays the image. However, any .paa exported via SQDev cannot be viewed using the same method.

Hm alright... That's very weird though. I am using Java's Files.copy method to copy files around.

Files.copy(file.toPath(), targetFile.toPath(), new CopyOption[] { StandardCopyOption.REPLACE_EXISTING });

and I assumed that this shouldn't change the copied files.
And since you are trying RegExes in the attributes, I assume you are on the dev-build of the plugin?
If not then I think this is indeed a duplicate of the referenced issue. In that case I'd advise you to get the latest dev-build available through the SQDev-Discord in #testing (its pinned to the channel)

@OfficialStamper
Copy link
Author

@Krzmbrzl I'm using 0.7.7 from the Releases tab, I suspect that is not your dev branch.

I do not see a dev branch, only Master, gh-pages and plugin.

If there is another version other than 0.7.7 that I could use, please advice. Happy to give feedback.

@Krzmbrzl
Copy link
Owner

Ah yeah that could be the problem then. As I wrote above the dev-version can only be downloaded via Discord from the #testing channel

@OfficialStamper
Copy link
Author

[note to self, always read the small print]

Yup, got your Dev from Discord, installing now. Will let you know, thanks for the quick and great response.

@Krzmbrzl Krzmbrzl added the with Dev-Build This issue has been resolved in the Dev-Build label Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues concerning bugs in the plugin with Dev-Build This issue has been resolved in the Dev-Build
Projects
None yet
Development

No branches or pull requests

2 participants