#include "subfiles/jpgsubFile.h"

#include "EasyLogging++/easylogging++.h"

namespace LOTRO_DAT {
namespace Subfiles {

SubfileData Subfile<JPG>::BuildForExport(const BinaryData &file_data) {
    SubfileData result;
    result.binary_data = file_data.CutData(24);
    result.options["ext"] = ".jpg";
    return result;
}

BinaryData Subfile<JPG>::BuildForImport(const BinaryData &old_data, const SubfileData &data) {
    BinaryData file_size = BinaryData::FromNumber<4>(data.binary_data.size());
    return old_data.CutData(0, 28) + file_size + data.binary_data;
}

}; // namespace Subfiles
}; // namespace LOTRO_DAT