new environment with multiple parameters

I’m trying to define a new environment which display an image and text below it.

I’ve tried the following code:

\newenvironment{essai}[1][]
{   \includegraphics[scale=0.25]{#1}
}
{
}

\begin{essai}{Images/dessin.pdf}
toto
\end{essai}


But, it throws an error that I do not understand:

! LaTeX Error: File ' not found.


Thanks in advance, any help would be very appreciate

• Remove []: \newenvironment{essai}[1]{...}{...} – egreg Jun 7 '18 at 10:11
• @egreg’s comment, or: Perhaps you want \newenvironment{essay}[2][] {\includegraphics[#1]{#2}} {}`. – GuM Jun 7 '18 at 10:38