Unity - Saving an image from a WebGL app to the users machine - unity3d

I`m building a character creator webGL app and want to enable people to "save" their avatar as a 500x500 PNG file on their desktop.
So far I have been using the exact code from the following source, which works for the Unity Editor:
https://www.reddit.com/r/Unity3D/comments/48hreq/saving_an_image_from_a_webgl_application_to_the/
However, in that topic they never got around to providing a solid answer on how to prompt the user to either download the generated image, or to open the image in a new tab so that they may download it themselves.
I have been testing multiple scripts, but at the end of the day i havent been able to come closer to a solution by myself.
Any pointers, tips or advice would be greatly helpful!

Related

How do I get started automating my workflow for enhancing and editing photos using Remini web app and photoshop?

I have hundreds of photos from the 70s-90s that I need to edit. I've left it for years because it is so labor intensive. I want to get it done. I have limited experience with DIY artificial pancreas systems as well as home automation systems like hubitat and am not afraid of a command prompt, but don't know how to start learning more to accomplish my current objectives.
Photos are stored in folders labeled by the year in which they were taken on my Mac desktop (latest OS). The photos go up by one integer each time. I need to automate the following:
Tell remini web app to upload the photo and enhance it (this usually takes 30 seconds to accomplish)
Save the finished photo (Remini automatically leaves the original name and adds remini enhanced to the end, so I don't need to worry about changing the names)
Rinse and repeat.
For Photoshop:
Open the photo from a specified folder, open the neural filters and apply the colorize option.
Save the photo as the same name it currently has plus put "photoshop edit" at the end.
Rinse and repeat.
After this completes, I will review the photos by hand and remove any that didn't work out. But being able to free up my time from clicking would help speed the process up.
Is this a possibility? How do I get started? Thank you!
I have been searching for information to help me get started but am concerned about the website thinking I am a bot if I do this.

Including non-standard resources in Unity HoloLens app

I'm building an app that must visualize a large point cloud on HoloLens 1st gen. As performance is an issue wit large clouds, I'm using Potree, an octree that takes care that only a preset number of points from the cloud are rendered.
The solution works in the editor, but, you guessed it, not when deployed on HL.
The point cloud in the Potree format is a set of couple of .json and hundreds of .bin files stored in hundreds of subfolders following the octree structure, all of that stored within a single folder, and the path to this folder is accessed by the renderer at runtime. However, I don't know how to include this folder in the HL app. Using Resources doesn't work as it's not really a standard resource. I've seen Asset Bundle suggested elsewhere, but according to this post asset bundling doesn't work on HL.
Is there a way to simply put this complex file structure in an accessible directory on HoloLens?
I feel completely stuck here and any help would be much appreciated.
Some of the things I've tried:
Keijiro Pcx doesn't work here. If rendered as single pixels, points cannot be seen in AR, and if rendered as meshes, the performance is abysmal (which led me to a conclusion octree structure should be used)
the solution here shows how to load one .xml file, but I have hundreds of files so I don't think it would work for me
similarly, this post deals with one .obj file
Unity 2019.4
HoloLens 1st gen
For anyone stumbling upon this - I ended up using Unity StreamingAssets and accessing the folder with Application.streamingAssetsPath - works beautifully!
Using pcx needs to be adjusted to binocular rendering in publishing settings. Please uncheck "Enable Depth Buffer Sharing" in XR Settings, and change "Single Pass" to "Multi Pass", as shown in the figure.enter image description here

Scratch 3.0 taking in a byte array for loading

I have been working on a project that is implementing Scratch 3.0 for a learning tool for children. We are going to be hosting it on an azure web application. We have hit a bit of a wall though and we aren't really sure how to get past it. The issue that we are having is that we are trying to have a user click on a project that they want to load into the Scratch 3.0 GUI and have a new page open where the user can then play/edit the project. However, Scratch 3.0 does not seem to have a functionality to do that yet. They have a loading feature that allows a file to be directly uploaded from the users computer though.
Is there anyway to change the function so that it would read a project from a byte array that would be sent from another web page?
Thanks in advance for the help!

Alfresco PDF thumbnail previews unreadable

Not sure this is the right stackexchange site but seems to be the place with the most question about Alfresco I can find so here goes.
Have Alfresco Community Edition 4.2.d installed on a RHEL5 64bit box (mainly default install bar using MySQL as a database locally). Uploading PDFs to the documentLibrary is fine and thumbnail previews and flash previews are generating. If the PDF has been processed by ABBYY OCR (which we have running on a separate server and is used to OCR scanned PDFs) then the flash preview generates fine but the thumbnail is incredibly dark and looks as if it has been attacked by a can of spray paint.
I initially thought it could be a ghostscript issue but have updated that to 9.14 and still getting this issue. I have also tried playing around with ImageMagik but I can't get a nice clear thumbnail to generate. I am guessing it is a switch in the convert command that Alfresco is using but I am struggling to work out a combination of switches that will work and then where Alfresco would store these parameters. Or indeed what switches are currently being used.
I was wondering if anyone had seen this behaviour before with ImageMagik previews in Alfresco 4.2.d? It seems something unique to PDFs that have been through the OCR process so I am guessing I will need to create a separate transformation for them at a later stage.
EDIT: So it was suggested that a later version of ImageMagick and GS should resolve it. I have therefore installed GS 9.14 and IM 6.8.9-0 (both compiled form source). Running the following from a command line:
convert /root/test1.pdf[0] /root/test1.png
results in a crystal clear image thumbnail preview. Thinking I was on to a winner I have amended the following lines in alfresco-global.properties to point to the system location of GS and IM:
img.root=/usr
img.dyn=${img.root}/lib
img.exe=${img.root}/bin/convert
img.gslib = /usr/local/share/ghostscript/9.14/lib/
and alfresco loads. However the thumbnail preview generated by Alfresco using the new version of IM and GS does not result in nice clean previews.
I am guessing that Alfresco is passing some command line switch during the conversion that is undoing the good work of the later versions of these programs. Does anyone know where the switches for thumbnail creation might be stored in Alfresco?
I guess it's related to transparency and default background black. I didn't find an easy way to add the required parameters to the script except to register a new transformer supporting more parameters like:
-fill white -opaque none

interactive pdf on the iOS

I have been looking for a way to present an interactive pdf file (created by in-design) on
the iPhone. I read a bunch of questions here but none says how to do it. The pdf file contain the text and in the middle it contains a 3d module, but when I present it on the iPhone it shows only the text and an empty white box where the module should appear.
Is it even possible to do it?
I'll be glad for any assistant on this subject or even where to look.
Thanks in advance,
Shahar.
Apple's PDF parser does not support 3D stuff. You're better of implementing the 3D part yourself and just adding that as a UIView on top of the PDF. There are several PDF frameworks that help with that (see https://stackoverflow.com/questions/3801358/pdf-parsing-library-for-ios)
Another alternative might be licensing Adobe's iOS rendering engine. But I doubt that they already added 3D support (or that they will be). Also, from what my sources tell me, pricing is rather high and apparently the framework not very developer friendly. (But I haven't used it myself)