SL-20173 show notification when file is empty
parent
7b54f077b4
commit
87f496cf7c
|
|
@ -50,6 +50,7 @@ bool LLImageDimensionsInfo::load(const std::string& src_filename,U32 codec)
|
||||||
|
|
||||||
if (file_size == 0)
|
if (file_size == 0)
|
||||||
{
|
{
|
||||||
|
mWarning = "texture_load_empty_file";
|
||||||
setLastError("File is empty",src_filename);
|
setLastError("File is empty",src_filename);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -90,7 +91,7 @@ bool LLImageDimensionsInfo::getImageDimensionsBmp()
|
||||||
if (signature[0] != 'B' || signature[1] != 'M')
|
if (signature[0] != 'B' || signature[1] != 'M')
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Not a BMP" << LL_ENDL;
|
LL_WARNS() << "Not a BMP" << LL_ENDL;
|
||||||
mWarning = "IncorrectFormat";
|
mWarning = "texture_load_format_error";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -141,7 +142,7 @@ bool LLImageDimensionsInfo::getImageDimensionsPng()
|
||||||
if (memcmp(signature, png_magic, PNG_MAGIC_SIZE) != 0)
|
if (memcmp(signature, png_magic, PNG_MAGIC_SIZE) != 0)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Not a PNG" << LL_ENDL;
|
LL_WARNS() << "Not a PNG" << LL_ENDL;
|
||||||
mWarning = "IncorrectFormat";
|
mWarning = "texture_load_format_error";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -185,7 +186,7 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg()
|
||||||
if (memcmp(signature, jpeg_magic, JPEG_MAGIC_SIZE) != 0)
|
if (memcmp(signature, jpeg_magic, JPEG_MAGIC_SIZE) != 0)
|
||||||
{
|
{
|
||||||
LL_WARNS() << "Not a JPEG" << LL_ENDL;
|
LL_WARNS() << "Not a JPEG" << LL_ENDL;
|
||||||
mWarning = "IncorrectFormat";
|
mWarning = "texture_load_format_error";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
fseek(fp, 0, SEEK_SET); // go back to start of the file
|
fseek(fp, 0, SEEK_SET); // go back to start of the file
|
||||||
|
|
|
||||||
|
|
@ -984,7 +984,11 @@ bool LLLocalBitmapMgr::checkTextureDimensions(std::string filename)
|
||||||
{
|
{
|
||||||
LLSD args;
|
LLSD args;
|
||||||
args["NAME"] = gDirUtilp->getBaseFileName(filename);
|
args["NAME"] = gDirUtilp->getBaseFileName(filename);
|
||||||
LLNotificationsUtil::add(image_info.getWarningName(), args);
|
if (!image_info.getWarningName().empty())
|
||||||
|
{
|
||||||
|
args["REASON"] = LLTrans::getString(image_info.getWarningName());
|
||||||
|
}
|
||||||
|
LLNotificationsUtil::add("CannotUploadTexture", args);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1000,6 +1004,7 @@ bool LLLocalBitmapMgr::checkTextureDimensions(std::string filename)
|
||||||
|
|
||||||
LLSD notif_args;
|
LLSD notif_args;
|
||||||
notif_args["REASON"] = mImageLoadError;
|
notif_args["REASON"] = mImageLoadError;
|
||||||
|
notif_args["NAME"] = gDirUtilp->getBaseFileName(filename);
|
||||||
LLNotificationsUtil::add("CannotUploadTexture", notif_args);
|
LLNotificationsUtil::add("CannotUploadTexture", notif_args);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -9102,7 +9102,7 @@ You locally updated a [RESOLUTION] baked texture for '[BODYREGION]' after [TIME]
|
||||||
icon="alertmodal.tga"
|
icon="alertmodal.tga"
|
||||||
name="CannotUploadTexture"
|
name="CannotUploadTexture"
|
||||||
type="alertmodal">
|
type="alertmodal">
|
||||||
Unable to upload texture.
|
Unable to upload texture: '[NAME]'
|
||||||
[REASON]
|
[REASON]
|
||||||
<tag>fail</tag>
|
<tag>fail</tag>
|
||||||
</notification>
|
</notification>
|
||||||
|
|
@ -11987,12 +11987,4 @@ Would you like to save them first?
|
||||||
yestext="Yes"/>
|
yestext="Yes"/>
|
||||||
</notification>
|
</notification>
|
||||||
|
|
||||||
<notification
|
|
||||||
icon="notifytip.tga"
|
|
||||||
name="IncorrectFormat"
|
|
||||||
priority="high"
|
|
||||||
type="notifytip">
|
|
||||||
Unable to upload '[NAME]' due to the following reason: incorrect image format.
|
|
||||||
</notification>
|
|
||||||
|
|
||||||
</notifications>
|
</notifications>
|
||||||
|
|
|
||||||
|
|
@ -3932,6 +3932,8 @@ Abuse Report</string>
|
||||||
|
|
||||||
<string name="DefaultMimeType">none/none</string>
|
<string name="DefaultMimeType">none/none</string>
|
||||||
<string name="texture_load_dimensions_error">Can't load images larger than [WIDTH]*[HEIGHT]</string>
|
<string name="texture_load_dimensions_error">Can't load images larger than [WIDTH]*[HEIGHT]</string>
|
||||||
|
<string name="texture_load_format_error">Incorrect image format.</string>
|
||||||
|
<string name="texture_load_empty_file">File is empty.</string>
|
||||||
<string name="outfit_photo_load_dimensions_error">Max outfit photo size is [WIDTH]*[HEIGHT]. Please resize or use another image</string>
|
<string name="outfit_photo_load_dimensions_error">Max outfit photo size is [WIDTH]*[HEIGHT]. Please resize or use another image</string>
|
||||||
<string name="outfit_photo_select_dimensions_error">Max outfit photo size is [WIDTH]*[HEIGHT]. Please select another texture</string>
|
<string name="outfit_photo_select_dimensions_error">Max outfit photo size is [WIDTH]*[HEIGHT]. Please select another texture</string>
|
||||||
<string name="outfit_photo_verify_dimensions_error">Cannot verify photo dimensions. Please wait until photo size is displayed in picker</string>
|
<string name="outfit_photo_verify_dimensions_error">Cannot verify photo dimensions. Please wait until photo size is displayed in picker</string>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue