<..graphics.4ht..>
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      
 % graphics.4ht                          2014-07-12-22:36 %
      
 % Copyright (C) 1997--2009       Eitan M. Gurari         %
      
 <.TeX4ht copyright.>
      
 
      
    <.fix graphics.>
      
 \Hinput{graphics}
      
 \endinput
      
 -_-_-
           
<..fix graphics..>
 \expandafter\let\csname includegraphics \endcsname\includegraphics
      
 \def\includegraphics{\expandafter\protect\csname includegraphics \endcsname}
      
 -_-_-
[example]
<..fix graphics..>+
 \def\grp:warning#1{\no:bound#1(no BoundingBox)//\:warning{#1}}
      
 \def\no:bound#1(no BoundingBox)#2//{\gdef\noBoundingBox{#2}\ifx
      
    \noBoundingBox\empty \global\let\noBoundingBox\:UnDef\fi}
      
 \let\:tempc=\Gin@setfile
      
 \pend:defIII\:tempc{\a:graphics
      
     \global\let\noBoundingBox\:UnDef
      
     \let\@latex@error=\grp:warning \let\@ehc=\empty}
      
 \append:defIII\:tempc{\b:graphics\grf:gobble\leavevmode grf:gobble}
      
 \HLet\Gin@setfile=\:tempc
      
 \NewConfigure{graphics*}[2]{%
      
    \expandafter\ifx \csname :.#1\endcsname\relax
      
       \pend:defIII\n:Gin@setfile:{\csname :.#1\endcsname}%
      
    \fi
      
    \def\:temp{#2}\ifx \:temp\empty
      
      \expandafter\let\csname :.#1\endcsname\:UnDef
      
    \else
      
      \expandafter\def\csname :.#1\endcsname{\def\:temp{.#1}%
      
         \ifx \:temp\Gin@ext  \let\a:graphics=\relax
      
            \def\G:cnfg{#2}\expandafter\grf:gobble \fi}%
      
    \fi }
      
 \NewConfigure{graphics}{2}
      
 \def\grf:gobble#1\leavevmode#2grf:gobble{%
      
    \PictureOff#1\PictureOn \G:cnfg \let\G:cnfg=\relax}
      
 \let\G:cnfg=\relax
      
 -_-_-
For figures of specific exytensions, we can tailor a configuration with the command ‘\Configure{graphics*}{extension}{action}’. For the other figures, we can use the configuration ‘\Configure{graphics}{before}{aafter}’.
Newer version
For xml