mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Screenshot dialog fixes
This commit is contained in:
@@ -174,15 +174,23 @@ namespace VRCX
|
|||||||
if (!metadataString.StartsWith("{"))
|
if (!metadataString.StartsWith("{"))
|
||||||
{
|
{
|
||||||
// parse VRC prints
|
// parse VRC prints
|
||||||
var xmlIndex = metadataString.IndexOf("<x:xmpmeta");
|
var xmlIndex = metadataString.IndexOf("<x:xmpmeta", StringComparison.Ordinal);
|
||||||
if (xmlIndex != -1)
|
if (xmlIndex != -1)
|
||||||
{
|
{
|
||||||
var xmlString = metadataString.Substring(xmlIndex);
|
try
|
||||||
// everything after index
|
{
|
||||||
var result = ParseVRCPrint(xmlString.Substring(xmlIndex - 7));
|
var xmlString = metadataString.Substring(xmlIndex);
|
||||||
result.SourceFile = path;
|
// everything after index
|
||||||
|
var result = ParseVRCPrint(xmlString.Substring(xmlIndex - 7));
|
||||||
|
result.SourceFile = path;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
logger.Error(ex, "Failed to parse VRCPrint XML metadata for file '{0}'", path);
|
||||||
|
return ScreenshotMetadata.JustError(path, "Failed to parse VRCPrint metadata.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.ConditionalDebug("Screenshot file '{0}' has unknown non-JSON metadata:\n{1}\n", path, metadataString);
|
logger.ConditionalDebug("Screenshot file '{0}' has unknown non-JSON metadata:\n{1}\n", path, metadataString);
|
||||||
|
|||||||
@@ -16112,7 +16112,7 @@ speechSynthesis.getVoices();
|
|||||||
) {
|
) {
|
||||||
var D = this.screenshotMetadataDialog;
|
var D = this.screenshotMetadataDialog;
|
||||||
var metadata = JSON.parse(json);
|
var metadata = JSON.parse(json);
|
||||||
if (typeof metadata === 'undefined' || !metadata.sourceFile) {
|
if (!metadata?.sourceFile) {
|
||||||
D.metadata = {};
|
D.metadata = {};
|
||||||
D.metadata.error =
|
D.metadata.error =
|
||||||
'Invalid file selected. Please select a valid VRChat screenshot.';
|
'Invalid file selected. Please select a valid VRChat screenshot.';
|
||||||
|
|||||||
@@ -37,13 +37,13 @@ mixin screenshotMetadata()
|
|||||||
el-carousel(ref="screenshotMetadataCarousel" :interval="0" initial-index="1" indicator-position="none" arrow="always" height="600px" style="margin-top:10px" @change="screenshotMetadataCarouselChange")
|
el-carousel(ref="screenshotMetadataCarousel" :interval="0" initial-index="1" indicator-position="none" arrow="always" height="600px" style="margin-top:10px" @change="screenshotMetadataCarouselChange")
|
||||||
el-carousel-item
|
el-carousel-item
|
||||||
span(placement="top" width="700px" trigger="click")
|
span(placement="top" width="700px" trigger="click")
|
||||||
img.x-link(slot="reference" v-lazy="screenshotMetadataDialog.metadata.previousFilePath" style="width:100%;height:100%;object-fit:contain")
|
img.x-link(slot="reference" :src="screenshotMetadataDialog.metadata.previousFilePath" style="width:100%;height:100%;object-fit:contain")
|
||||||
el-carousel-item
|
el-carousel-item
|
||||||
span(placement="top" width="700px" trigger="click" @click="showFullscreenImageDialog(screenshotMetadataDialog.metadata.filePath)")
|
span(placement="top" width="700px" trigger="click" @click="showFullscreenImageDialog(screenshotMetadataDialog.metadata.filePath)")
|
||||||
img.x-link(slot="reference" v-lazy="screenshotMetadataDialog.metadata.filePath" style="width:100%;height:100%;object-fit:contain")
|
img.x-link(slot="reference" :src="screenshotMetadataDialog.metadata.filePath" style="width:100%;height:100%;object-fit:contain")
|
||||||
el-carousel-item
|
el-carousel-item
|
||||||
span(placement="top" width="700px" trigger="click")
|
span(placement="top" width="700px" trigger="click")
|
||||||
img.x-link(slot="reference" v-lazy="screenshotMetadataDialog.metadata.nextFilePath" style="width:100%;height:100%;object-fit:contain")
|
img.x-link(slot="reference" :src="screenshotMetadataDialog.metadata.nextFilePath" style="width:100%;height:100%;object-fit:contain")
|
||||||
br
|
br
|
||||||
template(v-if="screenshotMetadataDialog.metadata.error")
|
template(v-if="screenshotMetadataDialog.metadata.error")
|
||||||
pre(v-text="screenshotMetadataDialog.metadata.error" style="white-space:pre-wrap;font-size:12px")
|
pre(v-text="screenshotMetadataDialog.metadata.error" style="white-space:pre-wrap;font-size:12px")
|
||||||
|
|||||||
Reference in New Issue
Block a user