Aspose.PSD pour Python via .NET 24.5 - Notes de version
Contents
[
Hide
]
Cette page contient les notes de version pour Aspose.PSD pour Python via .NET 24.5
Clé | Résumé | Catégorie |
---|---|---|
PSDPYTHON-60 | [Format AI] Ajout de la prise en charge des fichiers AI avec en-tête EPSF | Fonctionnalité |
PSDPYTHON-59 | La semi-transparence est traitée de manière incorrecte lors de l’aperçu du fichier psd | Problème |
PSDPYTHON-61 | Rendu d’un calque de forme partiellement incorrect | Problème |
PSDPYTHON-62 | Exception lors de l’enregistrement de fichiers PSD dont la taille dépasse 200 Mo et les grandes dimensions | Problème |
PSDPYTHON-63 | Échec de l’enregistrement de l’image en PDF après la mise à jour de 23.7 à 24.3 | Problème |
PSDPYTHON-64 | Correction du problème dans la méthode GetFontInfoRecords pour les polices chinoises | Problème |
Changements d’API publics
APIs ajoutées :
- P:Aspose.PSD.ImageOptions.PsdOptions.BackgroundContents
- P:Aspose.PSD.FileFormats.Ai.AiLayerSection.HasMultiLayerMasks
- P:Aspose.PSD.FileFormats.Ai.AiLayerSection.ColorIndex
APIs supprimées :
- Aucune
Exemples d’utilisation :
PSDPYTHON-59. La semi-transparence est traitée de manière incorrecte lors de l’aperçu du fichier psd
// La semi-transparence est traitée de manière incorrecte lors de l'aperçu du fichier psd.
// BackgroundContents assigné à Blanc. Les zones transparentes devraient avoir une couleur blanche.
sourceFile = "frog_nosymb.psd"
outputFile = "frog_nosymb_backgroundcontents_output.psd"
with PsdImage.load(sourceFile) as psdImage:
backgroundColor = RawColor(PixelDataFormat.rgb_32_bpp, 0)
argbValue = ctypes.c_int32(255 << 24 | 255 << 16 | 255 << 8 | 255).value
backgroundColor.set_as_int(argbValue) # Blanc
psdOptions = PsdOptions(psdImage)
psdOptions.color_mode = ColorModes.RGB
psdOptions.compression_method = CompressionMethod.RLE
psdOptions.channels_count = 4
psdOptions.background_contents = backgroundColor
psdImage.save(outputFile, psdOptions)
PSDPYTHON-60. [Format AI] Ajout de la prise en charge des fichiers AI avec en-tête EPSF
sourceFile = "example.ai"
outputFilePath = "example.png"
def assert_are_equal(expected, actual):
if expected != actual:
raise Exception("Les objets ne sont pas égaux.")
with AiImage.load(sourceFile) as img:
image = cast(AiImage, img)
assert_are_equal(len(image.layers), 2)
assert_are_equal(image.layers[0].has_multi_layer_masks, False)
assert_are_equal(image.layers[0].color_index, -1)
assert_are_equal(image.layers[1].has_multi_layer_masks, False)
assert_are_equal(image.layers[1].color_index, -1)
image.save(outputFilePath, PngOptions())
PSDPYTHON-61. Rendu d’un calque de forme partiellement incorrect
sourceFile = "ShapeLayerTest.psd"
outputFile = "ShapeLayerTest_output.psd"
with PsdImage.load(sourceFile) as image:
im = cast(PsdImage, image)
shapeLayer = cast(ShapeLayer, im.layers[2])
path = shapeLayer.path
pathShapes = path.get_items()
knotsList = []
for pathShape in pathShapes:
knots = pathShape.get_items()
knotsList.extend(knots)
newShape = PathShape()
bezierKnot1 = BezierKnotRecord()
bezierKnot1.is_linked=True
bezierKnot1.points=[
PointFToResourcePoint(PointF(100, 100), shapeLayer.container.size),
PointFToResourcePoint(PointF(100, 100), shapeLayer.container.size),
PointFToResourcePoint(PointF(100, 100), shapeLayer.container.size)
]
bezierKnot2 = BezierKnotRecord()
bezierKnot2.is_linked=True
bezierKnot2.points=[
PointFToResourcePoint(PointF(50, 490), shapeLayer.container.size),
PointFToResourcePoint(PointF(100, 490), shapeLayer.container.size),
PointFToResourcePoint(PointF(150, 490), shapeLayer.container.size)
]
bezierKnot3 = BezierKnotRecord()
bezierKnot3.is_linked=True
bezierKnot3.points=[
PointFToResourcePoint(PointF(490, 150), shapeLayer.container.size),
PointFToResourcePoint(PointF(490, 50), shapeLayer.container.size),
PointFToResourcePoint(PointF(490, 20), shapeLayer.container.size)
]
bezierKnots = [
bezierKnot1,
bezierKnot2,
bezierKnot3
]
newShape.set_items(bezierKnots)
newShapes = list(pathShapes)
newShapes.append(newShape)
pathShapeNew = newShapes
path.set_items(pathShapeNew)
shapeLayer.update()
im.save(outputFile, PsdOptions())
with PsdImage.load(outputFile) as image:
im = cast(PsdImage, image)
shapeLayer = cast(ShapeLayer, im.layers[2])
path = shapeLayer.path
pathShapes = path.get_items()
knotsList = []
for pathShape in pathShapes:
knots = pathShape.get_items()
knotsList.extend(knots)
assert len(pathShapes) == 3
assert shapeLayer.left == 42
assert shapeLayer.top == 14
assert shapeLayer.bounds.width == 1600
assert shapeLayer.bounds.height == 1086
PSDPYTHON-62. Exception lors de l’enregistrement de fichiers PSD dont la taille dépasse 200 Mo et les grandes dimensions
sourceFile = "bigfile.psd"
outputFile = "output_raw.psd"
referenceFile = "output_raw.psd"
loadOptions = PsdLoadOptions()
loadOptions.load_effects_resource = True
loadOptions.use_disk_for_load_effects_resource = True
with PsdImage.load(sourceFile, loadOptions) as psdImage:
opt = PsdOptions()
opt.compression_method = CompressionMethod.RLE
psdImage.save(outputFile, opt)
PSDPYTHON-63. Échec de l’enregistrement de l’image en PDF après la mise à jour de 23.7 à 24.3
sourceFile = "CVFlor.psd"
outputFile = "_export.pdf"
with PsdImage.load(sourceFile) as psdImage:
saveOptions = PdfOptions()
saveOptions.pdf_core_options = PdfCoreOptions()
psdImage.save(outputFile, saveOptions)
PSDPYTHON-64. Correction du problème dans la méthode GetFontInfoRecords pour les polices chinoises
fontFolder = "Font"
sourceFile = "bd-worlds-best-pink.psd"
psdLoadOptions = PsdLoadOptions()
psdLoadOptions.load_effects_resource = True
psdLoadOptions.allow_warp_repaint = True
try:
FontSettings.set_fonts_folders([fontFolder], True)
FontSettings.update_fonts()
with PsdImage.load(sourceFile, psdLoadOptions) as img:
image = cast(PsdImage, img)
for layer in image.layers:
if is_assignable(layer, TextLayer):
textLayer = cast(TextLayer, layer)
if textLayer.text == "best":
# Sans cette correction, il y aura une exception à cause de la police chinoise.
textLayer.update_text("SUCCÈS")
finally:
FontSettings.reset()
FontSettings.update_fonts()