首页 > 其他分享 >使用Thumbnails进行图片压缩,报“No suitable ImageReader found for source data”异常处理。

使用Thumbnails进行图片压缩,报“No suitable ImageReader found for source data”异常处理。

时间:2023-06-18 10:38:13浏览次数:42  
标签:Thumbnails No 0.3 fileThu byte suitable bigContent

先转一次byte数组  再处理

byte[] bigContent =file.getBytes();
                Thumbnails.of(new ByteArrayInputStream(bigContent)).scale(1f).outputQuality(0.3f).toFile(fileThu);
这里fileThu直接使用文件路径比较好



标签:Thumbnails,No,0.3,fileThu,byte,suitable,bigContent
From: https://blog.51cto.com/u_15242378/6507334

相关文章

  • pysnooper打印运行过程值
    #withimportrandomimportpysnooperdefprint_upper_mid_lower():lst=[]foriinrange(10):lst.append(random.randrange(1,1000))withpysnooper.snoop():lower=min(lst)upper=max(lst)mid=(lower+up......
  • 【题解】[NOIP2017 提高组] 逛公园
    题目描述:策策同学特别喜欢逛公园。公园可以看成一张\(N\)个点\(M\)条边构成的有向图,且没有自环和重边。其中\(1\)号点是公园的入口,\(N\)号点是公园的出口,每条边有一个非负权值,代表策策经过这条边所要花的时间。策策每天都会去逛公园,他总是从\(1\)号点进去,从\(N\)号......
  • 【C++】Effective Modern C++ Key Notes
    [errataveryimportant](https://www.aristeia.com/BookErrata/emc++-errata.html)>Argument,ActualArgument>Parameter,FormalParameter##一类型推导C++98有一套类型推导的规则:用于函数模板的规则。C++11修改了其中的一些规则并增加了两套规则,一套用于auto,一套用于dec......
  • Jupyter notebook代码自动提示补全
    1、第一步pipinstall-ihttp://pypi.douban.com/simple--trusted-hostpypi.douban.comjupyter_contrib_nbextensions 2、第二步jupytercontribnbextensioninstall--user 3、第三步pipinstall-ihttp://pypi.douban.com/simple--trusted-hostpypi.douban......
  • Windows10远程访问Ubuntu服务器上的Jupyter Notebook解决办法
    1、nginx反向代理 2、概要:可能有的同学在使用Python的时候喜欢使用.py文件,而有的同学喜欢使用JupyterNotebook做开发,但是苦于不会使用远程服务器的JupyterNotebook而放弃,而这篇文章将教会你怎样远程访问JupyterNotebook。官方地址:官方地址远访配置:创建JupyterNot......
  • ABC306 Poisonous Full-Course
    Atcoder题目链接题目大意Takahashi要品尝\(N\)个菜品.这些菜品中有些是有毒的,有些是解药.当他吃下第\(i\)个菜品时,他的总美味值会增加\(Y_{i}\),同时有以下效果:如果吃下的菜品是有毒的(\(X_{i}=1\)),且他现在的胃是健康的,他的胃转变为不舒服的;如果他现在的胃已......
  • The baby-bust economy “婴儿荒”经济 | 经济学人20230603版社论双语精翻
    2023年6月3日《经济学人》(TheEconomist)封面文章暨社论(Leaders)精选:《“婴儿荒”经济》(“Thebaby-busteconomy”)。baby-bust即“婴儿荒”(生育低谷),与历史上1946~1964年间著名的baby-boom即“婴儿潮”(生育高峰)相对立。Thebaby-busteconomy“婴儿荒”经济Globalfertilityhascoll......
  • luogu P1963 [NOI2009] 变换序列
    luoguP1963[NOI2009]变换序列题意对于\(N\)个整数\(0,1,\cdots,N-1\),一个变换序列\(T\)可以将\(i\)变成\(T_i\),其中\(T_i\in\{0,1,\cdots,N-1\}\)且\(\bigcup_{i=0}^{N-1}\{T_i\}=\{0,1,\cdots,N-1\}\)。,\(\forallx,y\in\{0,1,\cdots,N-1\......
  • Set up Your Diagnostic Interface for JPRO Commercial Diagnostics
    ThereareseveraldiagnosticinterfacesarecompatiblewithJPROCommercialVehicleDiagnosticssoftware.Youneedsetupyourdiagnosticsinterfaceinconfigurationsetting.Preparations:JPRONoregonCommercialFleetDiagnostics2023FreeDownloadNexiqU......
  • 请求被中止: 未能创建 SSL/TLS 安全通道,以及解决方法,即:Could not create SSL/TLS sec
    C#访问https请求被中止:未能创建SSL/TLS安全通道(CouldnotcreateSSL/TLSsecurechannel)以及X509Certificate2tempSignCert=newX509Certificate2(HttpContext.Current.Server.MapPath("cert/20050104.p12"),"123456");报:“System.Security.Cryptography.Cryp......