forked from old/legacy-imlib2
oooooooooooooooops
fix fix fix bug bug :) SVN revision: 4678
This commit is contained in:
parent
895027d9fe
commit
22cdb56e43
43
src/image.c
43
src/image.c
|
@ -1118,6 +1118,28 @@ __imlib_LoadImage(const char *file, ImlibProgressFunction progress,
|
|||
l->load(im, progress, progress_granularity, immediate_load);
|
||||
/* if it failed - advance */
|
||||
if (im->w == 0)
|
||||
{
|
||||
previous_l = l;
|
||||
l = l->next;
|
||||
}
|
||||
}
|
||||
/* if we have a loader then its the loader that succeeded */
|
||||
/* move the successful loader to the head of the list */
|
||||
/* as long as it's not alreayd at the head of the list */
|
||||
if ((l) && (previous_l))
|
||||
{
|
||||
im->loader = l;
|
||||
previous_l->next = l->next;
|
||||
l->next = loaders;
|
||||
loaders = l;
|
||||
}
|
||||
if (im->w > 0) im->loader = l;
|
||||
}
|
||||
else
|
||||
im->loader = best_loader;
|
||||
/* all loaders have been tried and they all failed. free the skeleton */
|
||||
/* image struct we had and return NULL */
|
||||
if (im->w == 0)
|
||||
{
|
||||
/* if the caller wants an error return */
|
||||
if (er)
|
||||
|
@ -1161,27 +1183,6 @@ __imlib_LoadImage(const char *file, ImlibProgressFunction progress,
|
|||
}
|
||||
errno = 0;
|
||||
}
|
||||
previous_l = l;
|
||||
l = l->next;
|
||||
}
|
||||
}
|
||||
/* if we have a loader then its the loader that succeeded */
|
||||
/* move the successful loader to the head of the list */
|
||||
/* as long as it's not alreayd at the head of the list */
|
||||
if ((l) && (previous_l))
|
||||
{
|
||||
im->loader = l;
|
||||
previous_l->next = l->next;
|
||||
l->next = loaders;
|
||||
loaders = l;
|
||||
}
|
||||
}
|
||||
else
|
||||
im->loader = best_loader;
|
||||
/* all loaders have been tried and they all failed. free the skeleton */
|
||||
/* image struct we had and return NULL */
|
||||
if (im->w == 0)
|
||||
{
|
||||
__imlib_ConsumeImage(im);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue