'Is there any Plugin compatible to unity that allows me to inscribe meta data into a file?
I'm trying to manipulate the meta data of an Image, so i can compress and decompress it without losing information, I can already read the image meta data, but I can't actually edit them.
I found this similar question: How to set extended file properties? But it doesn't seem to work today, as it is pretty old.
Edit: The project is for IOS and Android.
Solution 1:[1]
I managed to use SharpZipLib in unity: https://www.nuget.org/packages/SharpZipLib/ and compress the image to a zip:
using System.IO.Compression;
private string CompressImage(string picturePersistentPath)
{
string pictureCompressedPath = Path.Combine(Application.persistentDataPath, "Compressed.zip");
using FileStream originalFileStream = File.Open(picturePersistentPath, FileMode.Open);
using FileStream compressedFileStream = File.Create(pictureCompressedPath);
using var compressor = new GZipStream(compressedFileStream, CompressionMode.Compress);
originalFileStream.CopyTo(compressor);
return pictureCompressedPath;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Rafael Gomes |
