Trico-Everfire / p2-publishing-tool

MIT License
15 stars 2 forks source link

"You don't have a Preview Image", even after inserting one. #17

Closed fulano0esquerda closed 1 year ago

fulano0esquerda commented 1 year ago

image For some reason, regardless of the resolution, even after adding a Preview Image, the program seems to think that I haven't added a Preview Image yet. Neither the PNG or JPEG format works, with the only difference is that the JPEG one actually appears as "Invalid Image", while the PNG one appears normally, but the program gives the same error regardless of which format the Preview image is. This issue is present in both 1.0.0 and 1.0.1 release versions (which are the ones I tested).

Trico-Everfire commented 1 year ago

Can you send me the image in question? it's easier to locate the bug if I have the image in question. If you don't want to send the image, tell me it's resolution along with it's extension.

fulano0esquerda commented 1 year ago

Can you send me the image in question? it's easier to locate the bug if I have the image in question. If you don't want to send the image, tell me it's resolution along with it's extension. reboot_main Sure.

Trico-Everfire commented 1 year ago

This is odd. It works on my machine, I uploaded a test with the image and it successfully uploaded, according to the code the only thing able to trigger this message if you never inserted an image, however, this may be due to it's inability to save the current image as a thumbnail, causing it to never set it's path. I'll try to fix the issue and see how it works out. As for why the .png doesn't show at all, it's even stranger, but I'll see. it's likely either a permission issue (the application isn't allowed to create it's resources) or an issue with the way it tries to save the temporary resources.

fulano0esquerda commented 1 year ago

Okay, please let me know if you find out what's going on

Trico-Everfire commented 1 year ago

It is indeed some sort of save issue, it's incapable of saving the thumbnail on your machine (it grabs the image you shove into it, converts it to a jpg and rescales it to the only scale Portal 2's workshop seems to understand when it comes to the original preview image, as well as obeying the 1mb file limit), Either running the application in Administrator mode or allowing it to create directories and save images should vitiate the issue. I am gonna work on warning the user about this, as to why the PNG does not work is still unknown.

fulano0esquerda commented 1 year ago

Alright, thanks. Let me test this.

fulano0esquerda commented 1 year ago

Weird, I tried running it in Administator mode and it's still not working. The file size of the image doesn't seem to affect it either. I also tried to put the image inside the folder where the program is installed but had no effect.

Trico-Everfire commented 1 year ago

Where the image comes from doesn't really matter, it grabs the image from an absolute path. However, in the folder the .exe is housed in, can you add a directory with the name "resources", maybe it has trouble creating the directory.

fulano0esquerda commented 1 year ago

Wait, this is weird, the program is creating the "resources" folder normally when I select the image. But yet again, when I tried to click "upload", it still gave this error. (edit: It could be my antivirus, I'm going to add an exception in its settings and see if it works)

Trico-Everfire commented 1 year ago

Is there an image inside the resources folder?

fulano0esquerda commented 1 year ago

There are no images inside the resources folder. (edit: I added an exception and it's still not saving images to this folder.)

Trico-Everfire commented 1 year ago

This is what I feared, it is indeed unable to generate the image. My theory is that on windows the directory it creates is protected and won't allow itself to put anything inside. or something else is preventing it from working.

fulano0esquerda commented 1 year ago

What if I converted the image to fit the steam requirements and added it there inside the resources folder? Would it find it and try to upload it?

Trico-Everfire commented 1 year ago

I also have another theory, the library is unable to generate a JEPG, Which may be more likely at this point, this means it's a library error, and if so, I'd have to find and add the correct library. Can you try and run the uploader inside a command prompt and tell me what it logs when you try and upload an image, if there is an error when it tries to create the image, it'd likely spew an error of some kind, if not, I'll try my hand at a few solutions.

fulano0esquerda commented 1 year ago

image I just found out something. It's marking the folder to "read-only" every time I try to upload it. I unmarked it and tried upload the map but then it marked the folder to "read-only" again and gave me the error.

fulano0esquerda commented 1 year ago

I also have another theory, the library is unable to generate a JEPG, Which may be more likely at this point, this means it's a library error, and if so, I'd have to find and add the correct library. Can you try and run the uploader inside a command prompt and tell me what it logs when you try and upload an image, if there is an error when it tries to create the image, it'd likely spew an error of some kind, if not, I'll try my hand at a few solutions.

Okay, I'll try that

fulano0esquerda commented 1 year ago

For some reason, nothing's appearing in the command prompt when I run the program through it. I tried to upload the map, the program gave me the error and nothing appeared on it.

Trico-Everfire commented 1 year ago

I think the culprit has been found. mkdir in QT calls whatever API your OS is responsible for with no knowledge of permissions, It simply doesn't understand that what it's creating is incapable of being used.

fulano0esquerda commented 1 year ago

So, what would be the solution?

fulano0esquerda commented 1 year ago

I mean, I guess maybe I could try running it on a Linux Subsystem?

Trico-Everfire commented 1 year ago

You could, but I wanna fix it so it works on both platforms as advertised.

fulano0esquerda commented 1 year ago

Alright. I guess I'm gonna try to run it on Ubuntu, I really want to get this map released.

fulano0esquerda commented 1 year ago

Meanwhile, is there anything I could do to help? Like, doing a few more tests and stuff

Trico-Everfire commented 1 year ago

Currently no. This cause of issue with the folder may also be the reason on why Issue #15 exists, simply because it's trying to download those preview images, but never gets to do so because it's marked as readonly.

Trico-Everfire commented 1 year ago

I can provide you with a experimental copy that comes with a resources folder pre created, it removes the code responsible for creating it thus forever marking it as writable.

Trico-Everfire commented 1 year ago

A friend suggested to not put the uploader's binaries (and other files it comes with) not in Program Files, that may be protected, I will looking for a fix.

fulano0esquerda commented 1 year ago

Oh, right. I guess it could be it as well.

fulano0esquerda commented 1 year ago

Hm, Still didn't work.

fulano0esquerda commented 1 year ago

I can provide you with a experimental copy that comes with a resources folder pre created, it removes the code responsible for creating it thus forever marking it as writable.

Oh yeah, please do. Setting up Ubuntu is really annoying, lol

Trico-Everfire commented 1 year ago

It'll have to be later, my IDE is having a stroke and refuses to function.

fulano0esquerda commented 1 year ago

Okay

Trico-Everfire commented 1 year ago

Can you try this?

https://pipelines.actions.githubusercontent.com/serviceHosts/19566cf5-b296-4bf7-b2c1-7204eeca1707/_apis/pipelines/1/runs/81/signedartifactscontent?artifactName=p2-publishing-tool-windows-Release&urlExpires=2022-12-09T20%3A53%3A52.6387725Z&urlSigningMethod=HMACV2&urlSignature=jL%2BE3%2FehamawOPwQFxiV0nJ8eyK%2FbvsKeAN3VxQfhDY%3D

Trico-Everfire commented 1 year ago

I tried using the C++ standard library for creating the directories, which apparently hopefully does a better job than QT.

fulano0esquerda commented 1 year ago

This appears when I access the link: {"count":11,"value":"Uri expired"} Yeah, I guess I took too long to access it, my bad. I was busy doing something.

Trico-Everfire commented 1 year ago

p2-publishing-tool-windows-Release.zip

fulano0esquerda commented 1 year ago

Thanks.

fulano0esquerda commented 1 year ago

image Oof

Trico-Everfire commented 1 year ago

Okay, please hold on for a minute.

Trico-Everfire commented 1 year ago

p2-publishing-tool-windows-Release.zip

Trico-Everfire commented 1 year ago

This one you currently have to add the folder yourself.

Trico-Everfire commented 1 year ago

it will not even attempt to create one.

fulano0esquerda commented 1 year ago

Okay, cool. Gonna try it out

fulano0esquerda commented 1 year ago

image What the hell image

Trico-Everfire commented 1 year ago

is the folder empty?

fulano0esquerda commented 1 year ago

Hm, I don't think the folder was being set to Read-Only anymore, but either way, it's still not working.

fulano0esquerda commented 1 year ago

and yeah, it's empty

Trico-Everfire commented 1 year ago

I don't know what's causing this, but I'll take a look at it later, I've never experienced something like this before.

fulano0esquerda commented 1 year ago

Yeah, and I gotta go now. I hope you can find something that can help you fix this problem.

fulano0esquerda commented 1 year ago

I have an idea, how about you try to make a version that allows you to upload the map with a placeholder thumbnail to change it on steam later instead of requiring you to pick a custom one?

fulano0esquerda commented 1 year ago

Also, what are the requirements for the Linux version?