返回列表 发帖

[文件操作] 求exiftool程序的下载

求exiftool.exe程序的下载

TOP

回复 2# hfxiang


微信公众号下载的jpg文件,有一些在windows照片查看器中无法打开,其原因是内嵌了ICC文件。解决办法很简单,不需要改windows颜色配置的方法:
首先,去http://exiftool.org下载个免费的命令行程序exiftool.exe
建一个批处理文件Remove-icc.bat,用记事本编辑输入:exiftool -icc_profile= *.jpg 。
将exiftool.exe和Remove-icc.bat都放在需要更改的微信图片目录下,运行Remove-icc.bat,目录里面原jpg内嵌的icc文件都会被去除,并生成一个新的同名jpg。原jpg会自动更名为jpg_original文件,没有内嵌icc的jpg完全不影响。
按类型排序,删掉所有jpg_original文件,搞定收工。


上面这个情况,按照上面的方法为什么无效?

TOP

回复 3# wh123wh123


    请选一个“微信公众号下载的jpg文件,在windows照片查看器中无法打开”这样的图片上传到网盘,以便大家测试。
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

本帖最后由 wh123wh123 于 2024-4-21 16:30 编辑

回复 4# Batcher


把图片右键保存到电脑,然后点击图片看能不能直接打开显示?看是什么原因导致无法正常显示的,期待原因和最佳解决办法

TOP

回复 5# wh123wh123


  
https://exiftool.org/exiftool-12.83.zipCOPY
用这个
bat小白,请多指教!谢谢!

TOP

就是icc , 原本打不开的 , 填充icc信息就能打开了
请确保你确实是移除了icc (3楼那)

TOP

回复 3# wh123wh123

RemoveICCfromJPG.ps1
Add-Type -AssemblyName System.Drawing
$cp = New-Object CodeDom.Compiler.CompilerParameters
$cp.ReferencedAssemblies.Add([Reflection.Assembly]::GetAssembly([Drawing.Image]).Location) >$null
$cp.CompilerOptions ='/unsafe'
Add-Type -CompilerParameters $cp -TypeDefinition @"
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
public class ImageProcessor
{
    public static void RemoveICCProfile(string imagePath)
    {
        string tempPath = Path.GetTempFileName();
        using (Image image = Image.FromFile(imagePath))
        {
            if (image.PropertyItems.Length > 0)
            {
                foreach (PropertyItem propertyItem in image.PropertyItems)
                {
                    if (propertyItem.Id == 0x8773)
                    {
                        image.RemovePropertyItem(propertyItem.Id);
                    }
                }
            }
            image.Save(tempPath, ImageFormat.Jpeg);
        }
        File.Delete(imagePath);
        File.Move(tempPath, imagePath);
    }
}
"@
dir *.jpg | ForEach-Object {
    [ImageProcessor]::RemoveICCProfile($_.FullName)
}COPY

TOP

回复 8# buyiyang

Add-Type -AssemblyName System.Drawing
这个POWERSHELL直接就可以了吧

TOP

回复 6# 77七


@echo off
exiftool -icc_profile= *.jpg
pause

    'exiftool' 不是内部或外部命令
或批处理文件。
请按任意键继续. . .
这是咋回事?

TOP

回复 10# wh123wh123


   
把exe文件复制出来或者写exe的完整路径
1

评分人数

bat小白,请多指教!谢谢!

TOP

回复 9# terse


    用BAT或者VBS能不能解决?上面代码看不懂

TOP

回复 11# 77七


    哦,是需要修改文件名才行,.jpg_original这个文件是什么?可以删除吗?如何顺便让批处理删除掉?求个完整地批处理代码,期待老师

TOP

回复 9# terse


    ISE才可以

TOP

回复 13# wh123wh123


  
@echo off
cd /d "%~dp0"
set "_exiftool=D:\exiftool-12.83\exiftool(-k).exe"
"%_exiftool%" -icc_profile= *.jpg
del "*jpg_original"
pauseCOPY
bat小白,请多指教!谢谢!

TOP

返回列表