Keep paths to images using Parceljs - parceljs

Can I keep my folderstructure within my images folder when bundling with ParcelJS?
Now all files used in project get random filenames and are stored all in the same directory (cfr. dist||build)

Related

Retain built image from a different configuration in Yocto

I have different configuration files all corresponding to the same hardware board. The configurations correspond to different recipes that we want to include or exclude for our customers. Each configuration file also specifies a directory where the final built images are placed (with DEPLOY_DIR_IMAGE=deploy/images/somedir_suffix).
The problem is that whenever I build an image, bitbake -r foo.conf core-image-minimal, the previously built image, in a different directory, is also deleted. How can I build an image without cleaning / deleting the contents of the other directories in deploy/images ?
Our yocto version is 2.3

How do I access the an assets subdirectory with Directory in Flutter

I am working on an app in Flutter where I will have to find filenames that start with specific keywords in a directory (and then do things with those filenames subsequently). However, I am encountering trouble accessing the directory itself.
I have an 'assets' folder in the root directory of my project, as many online sources recommended, and a subdirectory in that directory. I include this subdirectory in my pubspec.yaml in the format 'assets/[subdirectory name]', and can generally access its contents with 'assets/[subdirectory name]/[filename]' with methods like loadString. However, when I try to access the directory like this: Directory('assets/subdirectory/'), a FileSystemException no such directory error is thrown. I have tried the usual combination of adding './' or removing the final slash, to no avail.
Are Directory filepaths relative to something else? Is there a better way to do this? Any help would be appreciated.
Directory() operates on the filesystem. You can't access assets with it because assets are bundled with the app during the build process.
During a build, Flutter places assets into a special archive called the asset bundle that apps read from at runtime.
https://docs.flutter.dev/development/ui/assets-and-images#asset-bundling
To get a list of assets in the app, you can use the undocumented generated file AssetManifest.json which contains a map of all bundled assets:
final assetsManifest = await DefaultAssetBundle.of(context).loadString('AssetManifest.json');
final assets = json.decode(assetsManifest).keys;
Another option (perhaps cleaner, since AssetsManifest.json is AFAIK indeed undocumented and might change in future versions) would be to simply make your own list of assets and save it as another asset (JSON file).

How can I save a local file into assets folder in Flutter

My flutter desktop application takes a local file (audio/video/image) as user input. Now I need to save it to somewhere for later usage. So that even if the device changes the application can still access them using relative path.
What I want to do is copy this file to assets folder using file.copy method. But how can I get the assets folder's directory? I don't want to hardcode assets folder's absolute path. Is there any way to copy files into assets folder using relative path?
Or any alternate way to do the task?
assets is read-only. Use documents directory where the application can store files that only it can access.
final directory = await getApplicationDocumentsDirectory();
See Read and write files for details.

WGet multiple directoriesdirectories

I am relatively new to the scene and am not that experienced with WGet (currently using VisualWGet, but also have cmd based WGet). I'm trying to download many (182,218 to be precise) images. I can get as far as downloading the first directory and all of the images within, then it will download only one image of each directory afterwards.
I am making sure to use a recursive search, but it seems like it does not want to enter the other directories after it exits out of the first one.
here's the process:
Downloads everything in directory 0
back tracks to parent directory
downloads first image in directory 1
downloads first image in directory 2
etc
The directory i'm trying to download from is http://66.11.126.173/images/ and each directory doesn't seem to be a link, rather an image that doesn't link to another directory.
The images are listed in directories as such
http://66.11.126.173/images/0/
http://66.11.126.173/images/1/
http://66.11.126.173/images/2/
etc
each directory has 31 variations of the same image and there are 5878 directories and I start my downloads in images/0/ otherwise it will want to download the index.html file for /images/
any help will be greatly appreciated.

PCLZIP restructure file paths

I'm wondering if it's possible to remove a parent directory using PCLZip while the archive is loaded; without extracting it first and recompiling it.
I can remove the parent directory in the archive using:
$zip->delete(PCLZIP_OPT_BY_INDEX, '0');
And the zip listContent seems to show the parent directory removed
but when I browse the loaded archive the child files and folders are still hosted in the parent directory. I believe this is because their structure definitions still contain the parent directory.
This should not be possible - for all entries in ZIP archive the path is stored fully, including all parent directories. So to remove part of this path will require to process all entries, and re-write an archive file since data in all entry headers will be changed.