zoukankan      html  css  js  c++  java
  • Atitit.识别损坏的图像

    Atitit.识别损坏的图像

     

    判断jpg图像损坏原理。读取gray line perc ent

    Png图片送货原理,直接回报EOFException

     

    /atiplat_cms/src/com/attilax/img/imgx.java

    int brk_pct = new imgx().GrayLinePercent(f);

     

    作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 ) 

    汉字名:艾提拉(艾龙)   EMAIL:1466519819@qq.com

    转载请注明来源: http://blog.csdn.net/attilax

     

     

    /**

    attilax    2016年9月28日  下午5:35:57

     * @param f

     * @return

     */

    public int GrayLinePercent(String f) {

    BufferedImage img = null;

    try {

    img = ImageIO.read(new File( f));

    } catch(EOFException e)

    {

    throw new PngFormatEx(f);

    }catch (IOException e) {

    ExUtil.throwEx(e);

    }

    return ( GrayLinePercent(img) );

     

    }

     

    /**

     *

    attilax    2016年9月28日  下午5:18:58

     * @param image

     * @return

     */

    public static int GrayLinePercent(BufferedImage image) {

     int heit=image.getHeight();

     int gray=0;

     for(int i=0;i<heit;i++)

     {

     if(i==185)

     System.out.println("dbg");

     PixLine pl=getPixLine(image, i);

     if(isGrayLinee(pl))

     gray++;

     }

    return (int) ((float)gray/(float)heit*100);

    }

     

     

    atiend

  • 相关阅读:
    linux修改主机名
    selinux详解及配置文件
    linux磁盘分区
    识别光纤,模块
    free命令详解
    Linux系统修改网卡名(eth0-3)
    CentOS7的systemctl使用
    ELK集群
    ELK故障:elk在运行一段时间后,没有数据。
    superviosrd进程管理
  • 原文地址:https://www.cnblogs.com/attilax/p/15198459.html
Copyright © 2011-2022 走看看