/*
 *  libpipi       Pathetic image processing interface library
 *  Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org>
 *                2008 Jean-Yves Lamoureux <jylam@lnxscene.org>
 *                All Rights Reserved
 *
 *  $Id$
 *
 *  This library is free software. It comes without any warranty, to
 *  the extent permitted by applicable law. You can redistribute it
 *  and/or modify it under the terms of the Do What The Fuck You Want
 *  To Public License, Version 2, as published by Sam Hocevar. See
 *  http://sam.zoy.org/wtfpl/COPYING for more details.
 */

/*
 * modular.c: hand-written codecs multiplexer
 */

#include "modular.h"


pipi_image_t *pipi_load_modular(const char *name)
{
    return pipi_load_jpeg(name);
}

int pipi_save_modular(pipi_image_t *img, const char *name)
{
    if(strlen(name) >= 4)
        if(!strncasecmp(&name[strlen(name) - 3], "jpg",  3) ||
           !strncasecmp(&name[strlen(name) - 4], "jpeg", 4) )
            return pipi_save_jpeg(img, name);
    return -1;
}
