标签: image-file

如何在PHP中使用scandir只获取图像?

有没有什么办法让仅与扩展的图像jpeg,png,gif等同时使用

$dir    = '/tmp';
$files1 = scandir($dir);
Run Code Online (Sandbox Code Playgroud)

php file-extension directory-structure scandir image-file

38
推荐指数
5
解决办法
6万
查看次数

Android - 将图像文件发送到服务器数据库

用户保存三个数据: 名称,注释图像.正如您可以看到下面的代码,我成功编写代码将名称和注释发送到服务器端.但是,我不知道如何将选定的图像文件从设备发送到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 Node names
    private static final String TAG_SUCCESS = "success";
    // Client-Server - End //////////////////////


    //Define Variables
    private EditText inputname;
    private EditText inputnote;
    private Button upload;
    private Bitmap yourSelectedImage;
    private ImageView inputphoto;
    private Button …
Run Code Online (Sandbox Code Playgroud)

android client-server http-post image-file

6
推荐指数
1
解决办法
3万
查看次数

是否有可能找到UIImage的文件扩展名?

我在NSData或UIImage查找图像类型中的以下代码,这有助于检查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;
}
Run Code Online (Sandbox Code Playgroud)

我想知道如何找到该文件是一个位图图像或不具有.bmp扩展名.有人可以请帮助我.修改上面的代码也可以找到bmp,或者请给我一些代码的解决方案.

谢谢你

file-extension objective-c uiimage image-file ios

5
推荐指数
1
解决办法
9960
查看次数

Android编辑system.img文件

我想将证书添加到我的图像文件中,以便稍后我可以使用该证书启动模拟器。

emulator -avd my_adb_device -system path_to_image_file
Run Code Online (Sandbox Code Playgroud)

但我不知道如何编辑图像文件。

我尝试了几件事但没有运气。

有什么想法可以实现这一点吗?

android system image-file

5
推荐指数
0
解决办法
3475
查看次数

第二个路径片段不能是驱动器或 UNC 名称

如何通过主文件夹中的环境路径文件夹读取文件夹中的所有图像文件:

   string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "mainFolder"); 
Run Code Online (Sandbox Code Playgroud)

例如,如果一个文件路径的内部文件夹是:

  Bitmap bmp = new Bitmap(path + "/folder/pic1.bmp");
Run Code Online (Sandbox Code Playgroud)

但我想阅读以下所有文件 mainFolder/folder

pic1.bmp
pic2.bmp
pic3.bmp
pic5.bmp
Run Code Online (Sandbox Code Playgroud)

不知道如何正确执行:

foreach (string imageFileName in Directory.GetFiles(path, "/folder/*.bmp"))
{
    using (Bitmap bmp = new Bitmap(imageFileName))
    {
      // process 
    }
}
Run Code Online (Sandbox Code Playgroud)

这样我就有:Second path fragment must not be a drive or UNC name

这样:

foreach (string imgFileName in Directory.GetFiles(path + "/folder/*.bmp"))
Run Code Online (Sandbox Code Playgroud)

我有:Illegal characters in path.

c# path bitmap environment-variables image-file

5
推荐指数
1
解决办法
2万
查看次数

在.bat文件中获取图像文件尺寸

我有一个bat文件,列出代码所在文件夹中所有图像的路径

@echo off
break > infofile.txt
for /f "delims=" %%F in ('dir /b /s *.bmp') do (
   echo %%F 1 1 1 100 100 >>infofile.txt 
)
Run Code Online (Sandbox Code Playgroud)


文本文件如下所示

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  
Run Code Online (Sandbox Code Playgroud)

我想要做的是用每个图像宽度和高度的尺寸替换100 100.感谢提前.

cmd batch-file image-file

2
推荐指数
1
解决办法
1万
查看次数

如果没有标签/ <无>标签,则无法删除泊坞窗图像

我正在使用码头工具,我发现当我运行时

docker images -a
Run Code Online (Sandbox Code Playgroud)

我有大量没有标签的图像,或者至少它们有标签

<none>
Run Code Online (Sandbox Code Playgroud)

这些在我的磁盘上浪费了太多的空间,现在一个df -h告诉我我的根已经满了.

我潜伏在互联网上,发现了

docker rmi -f $(docker images -a | grep "^<none>" | awk '{print $3}')
Run Code Online (Sandbox Code Playgroud)

至少会遍历所有没有的,但后来我得到了大量的错误信息.

Error: response from daemon: Conflict, <id> wasn't deleted
Error: response from daemon: Conflict, <id> wasn't deleted 
Error: response from daemon: Conflict, <id> wasn't deleted
Error: response from daemon: Conflict, <id> wasn't deleted 
etc...
Error: failed to remove images: [<list of all the image ids that I want gone>]
Run Code Online (Sandbox Code Playgroud)

这有点令人讨厌.有谁知道这些没有标记的图像是什么,为什么我的命令没有摆脱它们?

awk grep delete-file image-file docker

2
推荐指数
1
解决办法
779
查看次数

#include ansi C中的图像

我正在编写一个创建图像文件的程序.我希望在程序的二进制文件中对"原始"图像进行硬编码.

我刚在想...

char image[] = {
#include"image.jpg"
}
Run Code Online (Sandbox Code Playgroud)

但是我需要以某种方式将图像转换为可以作为char数组#included到ac文件中的格式?

c image-file c-preprocessor

1
推荐指数
1
解决办法
1493
查看次数

在云代工厂的grails应用程序中存储和显示图像文件

我有一个grails应用程序,它允许用户上传图像文件,并可以显示这些图像.应用程序实际上只将文件路径存储在数据库中,并将图像文件保存在文件系统中.

我读过一些帖子,说Cloud Foundry不支持本地文件系统访问.所以我的问题是,如果我想将我的应用程序部署到Cloud Foudry,我应该做哪些修改?我希望图像仍然可以直接显示在网页上,用户不必将它们下载到自己的计算机上进行查看.

grails file-access cloud-foundry image-file

0
推荐指数
1
解决办法
598
查看次数