image-file

Get image file dimensions in .bat file

こ雲淡風輕ζ 提交于 2020-01-12 04:01:26
问题 I have a bat file that lists the paths of all images in a folder the code is @echo off break > infofile.txt for /f "delims=" %%F in ('dir /b /s *.bmp') do ( echo %%F 1 1 1 100 100 >>infofile.txt ) The text file looks like this C:\Users\Charles\Dropbox\trainer\temp\positive\rawdata\diags(1).bmp 1 1 1 100 100 C:\Users\Charles\Dropbox\trainer\temp\positive\rawdata\diags(348).bmp 1 1 1 100 100 C:\Users\Charles\Dropbox\trainer\temp\positive\rawdata\diags(353).bmp 1 1 1 100 100 What I want to do is

Problems with structs in Swift and making a UIImage from url?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 04:34:26
问题 Alright, I am not familiar with structs or the ordeal I am dealing with in Swift, but what I need to do is create an iMessage in my iMessage app extension with a sticker in it, meaning the image part of the iMessage is set to the sticker. I have pored over Apple's docs and https://www.captechconsulting.com/blogs/ios-10-imessages-sdk-creating-an-imessages-extension but I do not understand how to do this or really how structs work. I read up on structs but that has not helped me accomplishing

C# - upload file by chunks - bad last chunk size

余生长醉 提交于 2019-12-11 12:58:38
问题 I am trying to upload large files to 3rd part service by chunks. But I have problem with last chunk. Last chunk would be always smaller then 5mb, but all chunks incl. the last have all the same size - 5mb My code: int chunkSize = 1024 * 1024 * 5; using (Stream streamx = new FileStream(file.Path, FileMode.Open, FileAccess.Read)) { byte[] buffer = new byte[chunkSize]; int bytesRead = 0; long bytesToRead = streamx.Length; while (bytesToRead > 0) { int n = streamx.Read(buffer, 0, chunkSize); if

attaching file and sending mail using smtp in android

◇◆丶佛笑我妖孽 提交于 2019-12-08 02:16:58
问题 in my application i'm sending mail using smtp.i want to attach image file to mail.how can i attach it?i tried it.but not getting image in mail.its giving small icon. please help.thanks in advance. below is mailing code and image of mail how it looks- public class MailImageFile extends javax.mail.Authenticator { public MailImageFile(){ } public void Mail(String user, String pass) { Properties props = new Properties(); props.put("mail.smtp.host", "smtp.gmail.com"); props.put("mail.smtp

attaching file and sending mail using smtp in android

瘦欲@ 提交于 2019-12-06 07:40:20
in my application i'm sending mail using smtp.i want to attach image file to mail.how can i attach it?i tried it.but not getting image in mail.its giving small icon. please help.thanks in advance. below is mailing code and image of mail how it looks- public class MailImageFile extends javax.mail.Authenticator { public MailImageFile(){ } public void Mail(String user, String pass) { Properties props = new Properties(); props.put("mail.smtp.host", "smtp.gmail.com"); props.put("mail.smtp.socketFactory.port", "465"); props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");

Is it possible to find the file extension of a UIImage ?

冷暖自知 提交于 2019-12-04 13:14:18
问题 I found the below code in Finding image type from NSData or UIImage which helps to check four different image types of a UIimage (NSString *)contentTypeForImageData:(NSData *)data { uint8_t c; [data getBytes:&c length:1]; switch (c) { case 0xFF: return @"image/jpeg"; case 0x89: return @"image/png"; case 0x47: return @"image/gif"; case 0x49: case 0x4D: return @"image/tiff"; } return nil; } I want to know how to find the file is a bitmap image or not that it has .bmp extension. can someone

Is it possible to find the file extension of a UIImage ?

我的梦境 提交于 2019-12-03 08:04:14
I found the below code in Finding image type from NSData or UIImage which helps to check four different image types of a UIimage (NSString *)contentTypeForImageData:(NSData *)data { uint8_t c; [data getBytes:&c length:1]; switch (c) { case 0xFF: return @"image/jpeg"; case 0x89: return @"image/png"; case 0x47: return @"image/gif"; case 0x49: case 0x4D: return @"image/tiff"; } return nil; } I want to know how to find the file is a bitmap image or not that it has .bmp extension. can someone please help me with it. Either modify the above code to find bmp as well or please provide me a solution

PHP Using str_replace along with preg_replace

本小妞迷上赌 提交于 2019-12-02 20:19:28
问题 I have a string of comma separated values that comes from a database, which actually are image paths. Like so: /images/us/US01021422717777-m.jpg,/images/us/US01021422717780-m.jpg,/images/us/US01021422717782-m.jpg,/images/us/US01021422718486-m.jpg I then do like below, to split them at the , and convert them into paths for the web page. preg_replace('~\s?([^\s,]+)\s?(?:,|$)~','<img class="gallery" src="$1">', $a) Works well, but in one place further in my page, I need to change the -m to -l

Android - Send Image file to the Server DB

你。 提交于 2019-11-29 00:25:03
Users save three data: name , note and image . As you can see the code below, I succeeded to code to send the name and note to the server side. But, I have no idea how to send a selected image file from the device to the serverDB. public class AddEditWishlists extends Activity { // Client-Server - Start ////////////////////// // Progress Dialog private ProgressDialog pDialog; JSONParser jsonParser = new JSONParser(); EditText inputName; EditText inputDesc; // url to create new product private static String url_create_product = "http://10.56.43.91/android_connect/create_product.php"; // JSON

Android - Send Image file to the Server DB

好久不见. 提交于 2019-11-27 15:15:26
问题 Users save three data: name , note and image . As you can see the code below, I succeeded to code to send the name and note to the server side. But, I have no idea how to send a selected image file from the device to the serverDB. public class AddEditWishlists extends Activity { // Client-Server - Start ////////////////////// // Progress Dialog private ProgressDialog pDialog; JSONParser jsonParser = new JSONParser(); EditText inputName; EditText inputDesc; // url to create new product private