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://www.cnblogs.com/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

  • 相关阅读:
    C语言的存储类别和动态内存分配
    C语言中复杂的声明
    C语言中typedef的解释_2
    C语言中类型限定符
    C语言文件I/O和标准I/O函数
    C语言中存储类别、链接与内存管理
    C++中static与const成员
    C++多态、虚函数、纯虚函数、抽象类
    sizeof结构体
    杂类
  • 原文地址:https://www.cnblogs.com/attilax/p/5930017.html
Copyright © 2011-2022 走看看