Imagedownloader
Author: u | 2025-04-24
ImageDownloader batch downloads pics from Reddit, Imgur: ImageDownloader is a portable open-source tool which can batch download images from your favourite subreddit, or Imgur Releases: Jameak/ImageDownloader. Releases Tags. Releases Jameak/ImageDownloader. v1.2.1. :51 . Jameak. v1.2.1 5d348be. This commit was signed with the committer’s verified signature. Jameak Marcus Quistgaard GPG
GitHub - dev-divyansh/ImageDownloader: ImageDownloader is
" + path); }}DownloadHandlerTextureInstead of using a DownloadHandlerBuffer to download an image file and then creating a texture from the raw bytes using Texture.LoadImage, it’s more efficient to use DownloadHandlerTexture.This Download Handler stores received data in a UnityEngine.Texture. On download completion, it decodes JPEGs and PNGs into valid UnityEngine.Texture objects. Only one copy of the UnityEngine.Texture is created per DownloadHandlerTexture object. This reduces performance hits from garbage collection. The handler performs buffering, decompression and texture creation in native code. Additionally, decompression and texture creation are performed on a worker thread instead of the main thread, which can improve frame time when loading large textures.Finally, DownloadHandlerTexture only allocates managed memory when finally creating the Texture itself, which eliminates the garbage collection overhead associated with performing the byte-to-texture conversion in script.ExampleThe following example downloads a PNG file from the internet, converts it to a Sprite, and assigns it to an image:using UnityEngine;using UnityEngine.UI;using UnityEngine.Networking; using System.Collections;[RequireComponent(typeof(UnityEngine.UI.Image))]public class ImageDownloader : MonoBehaviour { UnityEngine.UI.Image _img; void Start () { _img = GetComponent(); Download(" } public void Download(string url) { StartCoroutine(LoadFromWeb(url)); } IEnumerator LoadFromWeb(string url) { UnityWebRequest wr = new UnityWebRequest(url); DownloadHandlerTexture texDl = new DownloadHandlerTexture(true); wr.downloadHandler = texDl; yield return wr.SendWebRequest(); if(!(wr.isNetworkError || wr.isHttpError)) { Texture2D t = texDl.texture; Sprite s = Sprite.Create(t, new Rect(0, 0, t.width, t.height), Vector2.zero, 1f); _img.sprite = s; } }}DownloadHandlerAssetBundleThe advantage to this specialized Download Handler is that it is capable of streaming data to Unity’s AssetBundle system. Once the AssetBundle system has received enough data, the AssetBundle is available as a UnityEngine.AssetBundle object. Only one copy of the UnityEngine.AssetBundle object is created. This considerably reduces run-time memory allocation as well as the memory impact of loading your AssetBundle. It also allows AssetBundles to be partially used while not fully downloaded, so you can stream Assets.All downloading and decompression occurs on worker threads.AssetBundles are downloaded via a DownloadHandlerAssetBundle object, which has a special assetBundle property to retrieve the AssetBundle.Due to the way the AssetBundle system works, all AssetBundle must have an address associated with them. Generally, this is the nominal URL at which they’re located (meaning the URL before ImageDownloader batch downloads pics from Reddit, Imgur: ImageDownloader is a portable open-source tool which can batch download images from your favourite subreddit, or ImgurComments
" + path); }}DownloadHandlerTextureInstead of using a DownloadHandlerBuffer to download an image file and then creating a texture from the raw bytes using Texture.LoadImage, it’s more efficient to use DownloadHandlerTexture.This Download Handler stores received data in a UnityEngine.Texture. On download completion, it decodes JPEGs and PNGs into valid UnityEngine.Texture objects. Only one copy of the UnityEngine.Texture is created per DownloadHandlerTexture object. This reduces performance hits from garbage collection. The handler performs buffering, decompression and texture creation in native code. Additionally, decompression and texture creation are performed on a worker thread instead of the main thread, which can improve frame time when loading large textures.Finally, DownloadHandlerTexture only allocates managed memory when finally creating the Texture itself, which eliminates the garbage collection overhead associated with performing the byte-to-texture conversion in script.ExampleThe following example downloads a PNG file from the internet, converts it to a Sprite, and assigns it to an image:using UnityEngine;using UnityEngine.UI;using UnityEngine.Networking; using System.Collections;[RequireComponent(typeof(UnityEngine.UI.Image))]public class ImageDownloader : MonoBehaviour { UnityEngine.UI.Image _img; void Start () { _img = GetComponent(); Download(" } public void Download(string url) { StartCoroutine(LoadFromWeb(url)); } IEnumerator LoadFromWeb(string url) { UnityWebRequest wr = new UnityWebRequest(url); DownloadHandlerTexture texDl = new DownloadHandlerTexture(true); wr.downloadHandler = texDl; yield return wr.SendWebRequest(); if(!(wr.isNetworkError || wr.isHttpError)) { Texture2D t = texDl.texture; Sprite s = Sprite.Create(t, new Rect(0, 0, t.width, t.height), Vector2.zero, 1f); _img.sprite = s; } }}DownloadHandlerAssetBundleThe advantage to this specialized Download Handler is that it is capable of streaming data to Unity’s AssetBundle system. Once the AssetBundle system has received enough data, the AssetBundle is available as a UnityEngine.AssetBundle object. Only one copy of the UnityEngine.AssetBundle object is created. This considerably reduces run-time memory allocation as well as the memory impact of loading your AssetBundle. It also allows AssetBundles to be partially used while not fully downloaded, so you can stream Assets.All downloading and decompression occurs on worker threads.AssetBundles are downloaded via a DownloadHandlerAssetBundle object, which has a special assetBundle property to retrieve the AssetBundle.Due to the way the AssetBundle system works, all AssetBundle must have an address associated with them. Generally, this is the nominal URL at which they’re located (meaning the URL before
2025-03-27