NEW! PaintShop Pro 2019

HELP - testing script - Guides to slices

Moderator: Kathy_9

HELP - testing script - Guides to slices

Postby LeviFiction » Thu Feb 14, 2019 9:52 am

Hello,

I've created a script that reads a PSPImage to find all of the guides. I figure being able to do this would be helpful for any number of reasons. But, very specifically, this script uses guides to create cell slices of an image.

But I need some help.

I encountered one image, for reasons I cannot explain, that failed no matter what I tried. Then PSP crashed before I could save it to examine the file. Subsequent tests did not show the same error. Which has me perpelexed. I can't figure it out. So I was wondering if people would be willing to test the script and see if they can find an image that will cause the script to give an error?

Requirements: The script must be installed in the Scripts-Trusted folder as it accesses files on your harddrive, saves images, and access python libraries.

Video Demo of Script: https://drive.google.com/file/d/1yrp41n ... atXYg/view

Script Download: https://drive.google.com/open?id=1jS4iv ... JnCfrXdZVl
LeviFiction
Advisor
 
Posts: 5414
Joined: Thu Oct 02, 2008 1:07 pm
Location: USA
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP: 8, 9, X, XI, X2, X8,X9, 2018, 2019

Re: HELP - testing script - Guides to slices

Postby cosmicDread » Fri Feb 15, 2019 2:26 am

Hi Levi,

This was my first experience using Guides, so I had to look at the help file to figure out how to use them. The learning curve was short, and was I was able to find three short-comings in your code.

(1):
In the function 'getParts',
line #238 reads,
if len(guides) > 1:

which fails if there is only one guide.

(2): If there are no horizontal guides or no vertical guides, the code fails.

(3): If guides are off the grid or have been removed, then the code fails. It looks like PSP keeps these fields in the data block, but their coordinates are off the grid.

I made a few changes to your code and posted the file as an attachment.

This is a great script. I had no idea one could do such things with PSP. :D

Hopeful that this helps,
Charles
GuidesTest.zip
(3.16 KiB) Downloaded 23 times
When time runs out, forever becomes an option.
cosmicDread
 
Posts: 24
Joined: Fri Aug 26, 2016 7:10 am
Location: Lake Havasu City, Arizona
operating_system: Windows 7 Ultimate
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: ASUS Sabertooth X79 LGA 2011 Intel X79
processor: Intel Core i7-3930K
ram: 32 GB
Video Card: GeForce GTX 1080 Ti
Hard_Drive_Capacity: 5 TB
Monitor/Display Make & Model: Acer Predator X34
Corel programs: PaintShop X5, X6, X8, X9, '18, '19

Re: HELP - testing script - Guides to slices

Postby LeviFiction » Sat Feb 16, 2019 1:31 am

Thank you very much, I shall examine your changes carefully.
LeviFiction
Advisor
 
Posts: 5414
Joined: Thu Oct 02, 2008 1:07 pm
Location: USA
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP: 8, 9, X, XI, X2, X8,X9, 2018, 2019


Return to PSP Scripting

Who is online

Users browsing this forum: No registered users and 3 guests