Skip to content

Commit

Permalink
Batch wizard: do not display SVG size prompt on quick preview
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerhelland committed Nov 15, 2022
1 parent 47da52a commit 78e1c19
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Forms/File_BatchWizard.frm
Original file line number Diff line number Diff line change
Expand Up @@ -1723,9 +1723,9 @@ Private Sub UpdatePreview(ByVal srcImagePath As String, Optional ByVal forceUpda

'If the image load failed, display a placeholder message; otherwise, render the image to the picture box
If loadSuccessful Then
picPreview.CopyDIB tmpDIB
picPreview.CopyDIB tmpDIB, True, True
Else
picPreview.PaintText g_Language.TranslateMessage("previews disabled"), 10!, False
picPreview.PaintText g_Language.TranslateMessage("previews disabled"), 10!, False, True
End If

'Remember the name of the current preview; this saves us having to reload the preview any more than
Expand Down
13 changes: 9 additions & 4 deletions Modules/Loading.bas
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Attribute VB_Name = "Loading"
'General-purpose image and data import interface
'Copyright 2001-2022 by Tanner Helland
'Created: 4/15/01
'Last updated: 01/March/22
'Last update: add support for importing new layers from SVG/Z files
'Last updated: 15/November/22
'Last update: ensure SVG's that are "quick-loaded" do not display a size prompt UI
'
'This module provides high-level "load" functionality for getting image files into PD.
' There are a number of different ways to do this; for example, loading a user-facing image
Expand Down Expand Up @@ -518,7 +518,7 @@ Public Function LoadFileAsNewImage(ByRef srcFile As String, Optional ByVal sugge

'Restore the screen cursor if necessary, then set focus to the canvas
If handleUIDisabling Then Processor.MarkProgramBusyState False, True, (PDImages.GetNumOpenImages > 1)
FormMain.MainCanvas(0).SetFocusToCanvasView
If (Macros.GetMacroStatus <> MacroBATCH) Then FormMain.MainCanvas(0).SetFocusToCanvasView

'Report success/failure back to the user
LoadFileAsNewImage = (loadSuccessful And (Not targetImage Is Nothing))
Expand Down Expand Up @@ -614,6 +614,11 @@ Public Function QuickLoadImageToDIB(ByVal imagePath As String, ByRef targetDIB A
If cCBZ.IsFileCBZ(imagePath) Then loadSuccessful = cCBZ.LoadCBZ(imagePath, tmpPDImage)
If loadSuccessful Then tmpPDImage.GetCompositedImage targetDIB, True

Case "HGT"
Dim cHGT As pdHGT
Set cHGT = New pdHGT
If cHGT.IsFileHGT(imagePath) Then loadSuccessful = cHGT.LoadHGT_FromFile(imagePath, tmpPDImage, targetDIB)

Case "JLS"
loadSuccessful = Plugin_CharLS.LoadJLS(imagePath, tmpPDImage, targetDIB)

Expand Down Expand Up @@ -655,7 +660,7 @@ Public Function QuickLoadImageToDIB(ByVal imagePath As String, ByRef targetDIB A

Case "SVG", "SVGZ"
If Plugin_resvg.IsResvgEnabled() Then
If Plugin_resvg.IsFileSVGCandidate(imagePath) Then loadSuccessful = Plugin_resvg.LoadSVG_FromFile(imagePath, tmpPDImage, targetDIB)
If Plugin_resvg.IsFileSVGCandidate(imagePath) Then loadSuccessful = Plugin_resvg.LoadSVG_FromFile(imagePath, tmpPDImage, targetDIB, True)
End If

Case "XCF"
Expand Down
2 changes: 1 addition & 1 deletion PhotoDemon.vbp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ Description="PhotoDemon Photo Editor"
CompatibleMode="0"
MajorVer=9
MinorVer=0
RevisionVer=51
RevisionVer=54
AutoIncrementVer=1
ServerSupportFiles=0
VersionComments="Copyright 2000-2022 Tanner Helland - photodemon.org"
Expand Down

0 comments on commit 78e1c19

Please sign in to comment.