Unable to open PNG file with kview or PictureViewer; opens fine with other viewers - png

I have a PNG file created using libPNG library. The file opens perfectly on Windows picture viewer and MS Paint, but opening with kview (on Linux RHEL5) or QuickTime PictureViewer (on Windows) fails - the former reports a "libpng read error whereas the latter reports the file as being corrupted. A similar problem is seen when trying to process the PNG using ImageMagick library on Linux. Given that the PNG opens fine on some applications, it doesn't seem that the file is really corrupted; I therefore suspect some problem with version compatibility, but I am not sure. I tried searching the web but couldn't find any information on the root cause or a solution to this problem. Can someone please guide me on this?

Judging from the example image you posted in the comments, the problem is that your PNG lacks the ending IEND chunk -something you can test by opening it with tweakpng and inspecting the structure visually, or choosing "Check Validity-F5". It is somewhat predictable that those kind of PNG are displayed by some viewers and rejected by others.
If you are using libpng, it seems you forgot to call png_write_end()

Related

Unity Microgame WebGL upload not working (500 Internal Server)

I am trying to go through the Unity Essentials tutorials. The last step for the Microgame tutorial is the publication of the game. I've been trying to upload the Microgame using WebGL in Unity as instructed for the past three days to no avail. As of now, it says there was an internal server error (code 500). Does anyone know what might be happening?
I found a relevant post on SO where they stated that it was an issue not relating to Unity. However, before the internal 500 error I'm getting now appeared, my Unity Publishing loading bar would freeze at 2% on a different microgame.
Things I've tried: Restarting the computer, reinstalling unity hub and editor, deleting project and restarting, trying a different Microgame, and waiting it out for three days.
You can try changing the compression format, and/or enabling decompression fallback.
These configurations can be found in the Player Settings
Edit>Project Settings>Player
There are 3 compression settings for WebGL
gzip This is the default option. Gzip files are bigger than Brotli files, but faster to build, and natively supported by all browsers over both HTTP and HTTPS.
Brotli Brotli compression offers the best compression ratios. Brotli compressed files are smaller than gzip, but take a longer time to compress, which increases your iteration times on release builds. Chrome and Firefox only natively support Brotli compression over HTTPS.
Disabled Disables compression. Use this option if you want to implement your own compression in post-processing
scripts
. You should also use it if you plan to use static compression on the hosting server.
In addition, enabling decompression fallback may be the correct option.
When you enable decompression fallback, Unity adds a .unityweb extension to the build files. You should consider using Decompression Fallback if you have less experience with server configuration, or if server configuration is unavailable to you.
Note: Using this option results in a larger loader size and a less efficient loading scheme for the build files.
Unity Reference
I had the same issue...
when publishing to WebGL... the unity editor was giving internal server error.
So, i tried to loging to unity play and check what is going on.. as soon as i log in to unity play. the browser gave me internal server error...
So, i changed the browser (Firefox) to Google Chrome.... and it worked...
What you have to do is... change your default browser.
I hope it works for you ...
Enjoy.
I've had this issue for a couple releases now. Made a project for WebGL and always builds fine but after the upload I get a 500 error every time. Guess I've made a PC app now. Contacted support by email, this is where they sent me, so must be the correct thread. I have tried all the compression options.
2023 Solution
None of the other answers will fix the problem. The good news is, even if your Unity Editor tells you that failed the operation with the Error 500 Internal Server %99 of the time it's uploading to the server.😯
So, you should immediately check the Unity website https://play.unity.com under My Games Section (scroll down a little bit on the home page). You might find lots of successful uploads already there!
In 2022 I've faced the same issue, I forgot to share the answer, this year I'm facing the same exact issue again. But in fact, it's just an editor's upload tool's fault perhaps. I'm not sure.
Hope this will help someone else.

Corrupt Word docx (OpenXML) fixed by Libreoffice - how to identify possible root cause?

I am trying to identify the root cause of a corrupted Microsoft Word docx, the file being the result of a PDF conversion using commercial software. When trying to open this doc in MS Word, I get an error message saying nothing specific, only that the file is corrupted and cannot be opened.
Now, the same file opens fine in Libreoffice. When saving the file as docx from within Libreoffice, I am also able open it in Word again. There are quite a few differences in the contents of the XML files in the unzipped docx file (checked with a diff tool) compared to the one created by Libreoffice. However, I am not sure which ones exactly would cause the file create by Libreoffice to be uncorrupted.
Also, if I unzip the docx and rezip it again, it also opens fine in Word afterwards. I checked the two files on the binary level using a Hexeditor and there were quite a few differences, but it is rather hard or even impossible to understand what these differences mean.
Has anyone has a similar situation and might be able to shed some light on this? I am not sure where to start. Tks.
Problem was solved by doing a roundtrip conversion using the Apache POI library (poi.apache.org)

How to convert a SB3 file to an EXE

I'm creating a game on Scratch 3, however, when I'm finished with it, I want to convert it to an .exe file. How do I do this?
I've been interested in game development for a long time, and have even tried Unity before, but I'm just a beginner meaning it was too difficult for me. So I turned to Scratch.
Yes, It is possible! ...But it's kinda complex,
Bear with me!
First, Take your sb3 file and convert it into a sb2. To do this I recommend using rexscratch's sb3tosb2 tool. Found here: https://github.com/RexScratch/sb3tosb2
Make sure you have python installed, if you don't, google how to install it. (it's easy).
Next, Click Clone or Download then click Download ZIP. Once that is downloaded, Open the zip, go to the next folder, and execute sb3tosb2.py . This will then ask for a sb3 file, Navigate to the sb3 file you have and select it. It may say it wants to work in compatibility mode, if it does, Just accept it. It will finish up and ask you where to put a sb2 file, just place it on your desktop and name it something.
Secondly, We need to use a program called junebeetle, Don't worry, it's a web based one, found here: https://junebeetle.github.io/converter/online/
Click open scratch file. It will ask for a sb2, Navigate to where you put the sb2 file and open it. If you want you can customize how it will open, you can. I like to use the auto start function, and fullscreen. Don't mess with the resolution unless you know not how to screw-up aspect-ratios. Then click "Convert to SWF" This will then download the SWF version the scratch game, simply name it what you want and leave it.
Finally, you need to convert the SWF file to an EXE, There are plenty of ways to do this, but for ease, I recommend using a lite file converter. SWF Tools is a good one found here: https://sourceforge.net/projects/swftools/files/SwF_To_eXe/Swf2eXe_Latest.zip/download
Let it download and then extract the zip file's content to your desktop or downloads folder. Then open the exe file inside the folder from the zip file you just extracted.
Almost there! Click "Add a file" Then, you guessed it, Navigate to the SWF file that was spat out from the conversion of the sb2. Then click "Convert" Let it do its thing, and soon it will finish. Boom, Done. To find your exe file, go to where you stored the SWF to EXE converter, go to the "Output" Folder, and infront of you, is your EXE File! Note: Your anti-virus might freakout, this is normal when making new programs.
Also, Some fonts may break, This is just a side effect of the sb3 to sb2 conversion due to the fact that there is currently no way to convert sb3 to SWF.
Hopefully that was easy enough to understand. It is a complicated process, But yields results!
If you have any issues, Just Ask! I can help!
You could use the TurboWarp Packager. It's free and safe. https://packager.turbowarp.org/
There might not be a specific or direct way to convert a Sb3 File to an exe file but You can do it indirectly in a few steps which might be kind of lengthy but works.
When your SB3 project is done, go to https://sheeptester.github.io/htmlifier/
And convert your sb3 file to html.
From there you can convert the html file you got just now to an exe file, but not as you might expect it to. You cannot convert an html page to an exe file so what you can do is add the html webpage (the scratch game now converted to a html webpage) as an 'embed' file in the software such as, like Unity or Visual Basic, as they allow html webpages to be embedded in a project. Then you can add features and stuff, then publish or export your project as an exe file.
I know the process is really lengthy and I practically just wrote a long boring thesis but this might be the only way you can convert scratch to exe.
Hope my answer helps!
Hasta La Vista
Convert your Scratch project to HTML using Scratch HTMLifier: https://sheeptester.github.io/words-go-here/htmlifier/
Download NW.js and put its files (nw.exe, ...) in a directory. Create a package.json file in that directory that should look like this:
{
"name": "Project",
"main": "project.html"
}
(replace Project with the name of your project and project.html with the name of your HTML file).
Make sure that your project runs when you start nw.exe.
Use any tool to turn your folder into a self-extracting archive.
See also: https://scratch.mit.edu/discuss/topic/341617/
use https://packager.turbowarp.org/
Using simple setting you can export without any problems.
This post is marked obsolete because the content is out of date. It is not currently accepting new interactions.
Currently, there is no software or smart javascript tricks that can convert .sb3 files into .exe files. You could use an .sb2 file but you need to use Scratch 2.0. There are developers working on conversion programs that do .sb3 to .exe but that will take a while. I would recommend using Scratch 2.0 if you want to convert your Scratch games to an executable.

Can’t submit file for Facebook App Approval

I’ll set my outrage with the way this process works (to whom can I speak?) aside for the moment: we are attempting to provide FB with a link to our ~200 mb app for approval. We have been rejected 3 times because they are incapable of extracting our zip file (they request a zip for some unknown reason — it has minimal size impact).
Some detail: we are linking to the zip on our Dropbox. We have removed all punctuation from our app title (Pandamonium!.app becomes Pandamonium.app). We have eliminated spaces from our source folder. I thought all these could be causing a problem with iOS-sim.
I’m not sure what is left to do, but I am hoping someone can present a clear set of instructions (NOT THEIR INSTRUCTIONS, WHICH I HAVE READ) they have followed particularly if you have met similar snags or ANY ideas for resolution. All they send me is useless screenshots of their simulator unable to open the app which I have simulated and opened successfully daily with iOS-sim for the last week.
After a great deal of trial and error I found that using Facebook's command-line instructions was what was causing the issue. You should just compress your .app file in an ordinary fashion (right click and compress -- I used a Windows computer just to make sure everything was copasetic after reading about bizarre Mac .cbgz compression issues).
Regardless, in summary, I can now see why no one else has had an issue with this: it's because no one reads their instructions and rather just creates their .zip files in the ordinary way; unsurprisingly, you're better off using your common sense rather than listening to others.
Aside: ironically, after being told my use case was fine and the only issue was not being able to unzip, Facebook (India) has now told me they couldn't find my login button (which is gigantic, in multiple places, and clearly described in my instructions). This process is an absolute joke. I wish anyone going through this hell good luck.

Any method to restore garbled/distorted text file by Matlab?

I got a very weird situation that highly needs your assistance. I appreciate your effort and time in advance.
I have a machine which produces a text file that records some information of the machine's working status such as, the coordinate of the drill head and the rotating speed used at that position. While we examine the text file, it appears to be unreadable because most of the contents are garbled. Please see the attached figure. http://ppt.cc/sA1I
If I open it with UltraEdit I see: http://ppt.cc/TrnV
As you can see some part of the file is readable; however many unrecognizable characters, which should be those numeric values we want.
Two reasons that I believe this problem should be solved by Matlab. First, I am sure this machine has many built-in matlab code inside for analysis purpose. Second, we have a .exe file, which is compiled by Matlab, can restore the garbled text file into arranged and readable format (the values of the coordinates are restored).
We desperately want to see the contents of this file by ourselves. Please kindly provide solution or idea or any direction for me to solve this issue.
Sincerely,
Old question without answer: For the record, a suggestion.
Sounds like a case of Mojibake, a problem with text encoding. Here's how I solved it.
Background: I had text files created on a Mac, others on a Windows, others still on Linux, each in different text encoding. So I got a text editor that would allow me to view the format and to change it. In my case, I used TextMate on MacOS, opened the files, picked the correct encoding upon opening, which sometimes was a Windows format, a Mac format, sometimes a Latin format -- had to use trial and error to figure it out based on a preview this particular piece of software gave me. Once I had the file opened in the correct encoding, I would save it in the utf-8format, which is not platform-specific and allows me to move my text files across various computers.
There may be more scalable methods, but I only had a hundred or so files to deal with, so I opted for the manual method, in order to personally visualize the rendering on screen, and because my files came in different encoding to begin with.