' $ Adjusts photo height to 133% (for 16x9) and maximises size (to 7k pixels) ' 'The project.xml will have already been parsed to add cr/lf, and it + all the .jpg's will be in /PhotoStory sub-folder ' ' ' DECLARE SUB get2vals (in$, middl$, end$, dmy1$, frwd%, dmy2$, frht%) DECLARE SUB adjCrop (in$, zoom!) CLEAR ' ' can't use the double-quote symbol (") in a line of qbasic code, so assign it to a variable in case we need it q$ = CHR$(34) ' OPEN "C:\QBASIC\PSTORY3\Project.xml" FOR INPUT AS #1 OPEN "C:\QBASIC\PSTORY3\x133.xml" FOR OUTPUT AS #2 ' DO LINE INPUT #1, in$ ' find the next image Qpos = INSTR(in$, " 1 THEN GOTO skip1 ' OK, got the image def. now find the jpg name it's from first double quotes to second Q1pos = INSTR(in$, q$) Q2pos = INSTR(Q1pos+1, in$, q$) iname$ = MID$(in$, Q1pos+1, Q2pos-Q1pos-1) 'extract the width and height, breaking the line into 3 parts CALL get2vals (in$, middl$, end$, "width=", imgwd%, "height=", imght%) ' calculate the new image height and width (maximise the image size but stay within the 7000 limit) ' Calc zoom to take the height to 5250 (before the 133 distort) Note '!' means (single precision) float zoom! = 5250 / imght% newwd% = zoom! * imgwd% ' if this zoom takes the width over 7000, change it IF newwd% > 7000 THEN zoom! = 7000 / imght% ' OK, now set new width & height newwd% = (zoom! * imgwd%) nwd$ = mid$(str$(newwd%),2) newht% =(4 * zoom! * imght%) / 3 nht$ = mid$(str$(newht%),2) 'go generate the new photo - ' rename {numb}.jpg as old renam$ = "REN C:\QBASIC\PSTORY3\" + iname$ + " temp.jpg" SHELL renam$ ' ok now go do the convert conv$ = "C:\IM66210\convert.exe C:\QBASIC\PSTORY3\temp.jpg -adaptive-resize "+nwd$+"x"+nht$+"! C:\QBASIC\PSTORY3\" + iname$ SHELL conv$ ' OK, done it, remove temp SHELL "DEL C:\QBASIC\PSTORY3\temp.jpg" ' recombine the