Categories
Linux Mastering Development

Need help with linux bash script

I already tried to find answer here, but didn’t find. I am sorry my bad english, because it is a bit hard for me to speak english. I also have almost none bash scripting skills, so my script may look very bad. It’s jus made from examples what I could find from internet, but now […]

Categories
Linux Mastering Development Ubuntu

Pipe script output in terminal to filter lines

#!/bin/bash for f in *.{jpg,png,webm,mp4}; do mv “$f” “$(sed ‘s/[^0-9A-Za-z_.]/_/g’ <<< “$f>; done Currently using this script to turn all of the specified files of that extension and strip their special characters, but I’m wondering if it’s possible to then pipe that and filter the useless output (namely the warning that a file was skipped […]

Categories
Linux Mastering Development

How do I delete a folder but only keep selected files?

My folder structure is as follows: Photos | |—> 2015-08-23 | |—> IMG_0019.JPG // keep IMG_0019.JPG.json // toss IMG_0020.JPG // keep IMG_0020.JPG.json // toss IMG_0021.JPG // keep IMG_0021.JPG.json // toss metadata.json // toss 2015-08-24 | |—> IMG_0242.MP4 // keep IMG_0242.MP4.json // toss metadata.json // toss 2015-08-25 | |—> IMG_0243.MOV // keep IMG_0243.MOV.json // toss IMG_0243(1).MOV […]

Categories
Development

How to Write Floating-Point-based Image to a file?

Using the code found here, I’ve written code that stores image data where each color component in a floating point value. // Create a TYPE_FLOAT sample model (specifying how the pixels are stored) SampleModel sampleModel = new PixelInterleavedSampleModel(DataBuffer.TYPE_FLOAT, options.width, options.height, 4, options.width * 4, new int[]{0,1,2,3}); // …and data buffer (where the pixels are stored) […]

Categories
CMS Development Magento

how can we update image from custom grid field?

I have created custom module, that work front end and back end also. when i fill up data from fronted its save data in to database. now i fetch all data in my custom grid field, but for image field i don’t how to edit/update and set into database also… Form.php Vendor\Module\Block\Adminhtml\Post\Edit\Form.php <?php namespace Vendor\Module\Block\Adminhtml\Post\Edit; […]

Categories
CMS Development Magento

how can we update image from custom grid field?

I have created custom module, that work front end and back end also. when i fill up data from fronted its save data in to database. now i fetch all data in my custom grid field, but for image field i don’t how to edit/update and set into database also… Form.php Vendor\Module\Block\Adminhtml\Post\Edit\Form.php <?php namespace Vendor\Module\Block\Adminhtml\Post\Edit; […]

Categories
Development User Help

Win7 Batch rename multiple image formats in folder with multiple periods in file name

I want to rename thousands of images (several extensions; png, jpg, gif) in a certain folder with the folder name followed by a ascending number, but the problem is when images have multiple dots/periods in the filename, the name gets cut off after the first period, than the file gets a wrong extension. For example: […]

Categories
Development

Running a SavedModel in TensorFlow 2 with inputs of a specific type

I’m trying to run an object detection model I have prepared in SavedModel format in TensorFlow 2. The model takes inputs in the format of a byte-encoded JPEG, PNG, or GIF as encoded_image_string_tensor:0 and outputs the typical detection_scores:0, detection_boxes:0, etc. In TensorFlow 1.15, I can do the following operations: with tf.Session(graph=tf.Graph()) as sess: tf.saved_model.loader.load(sess, [“serve”], […]

Categories
Development

need help on how to upload accordingly using php and dropzonejs

this is what I have so far function_upload since I’m uploading multiple files so each file gets looped to the correct format/type of documentand I know I have to add my dropzone.options after this but its not working need help figuring it out: function action_upload($id){ if(!empty($_FILES)) { // $_FILES[‘filename’][‘tmp_name’] foreach($_FILES[‘filename’][‘tmp_name’] as $key => $value) { […]

Categories
Development

How Do I Upload a File To a Folder Online Without Getting “Access to the path is denied”

I am trying to upload an image file to my web application online. This is how am uploading images file online. if (!FileUploadPropertyImage.HasFile) { Skin.AddModuleMessage(this, Localization.GetString(“NoFileFound.ErrorMessage”, LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); return; } string PictureFileTypeAccepted = “jpg,png,gif”; if (FileUploadPropertyImage.PostedFile.ContentLength <= maxFileSize * 1024) { string fileName = FileUploadPropertyImage.FileName.ToLower(); string extension = Path.GetExtension(fileName); if (PictureFileTypeAccepted.Contains(extension.ToLower())) { System.Drawing.Bitmap objBmp = […]