Subversion Repositories filter_foundry

Compare Revisions

No changes between revisions

Regard whitespace Rev 439 → Rev 440

/trunk/TODO.md
5,9 → 5,8
ToDo for the next release
-------------------------
 
* Make some parts of the code Unicode aware. Note that Photoshop itself (PIPL etc) doesn't seem to be Unicode aware, and PARM is also not Unicode aware. So the Title/Category/... stays ANSI! But we should allow that filters are loaded/saved from File Dialogs that can read/save Unicode folder names.
(None)
 
 
Known bugs
----------
 
14,11 → 13,14
* SEVERE: After working with Filter Foundry for a short amount of time (working with sliders, applying, opening again, changing sliders, etc.), the file save dialog (Make dialog) will corrupt the memory!!! You notice it by seeing that icons and folder icons are missing! Later, the program might even crash! (Verified with 1.7.0.12, verified with Visual Studio and OpenWatcom) Application Verifier does not report anything bad.
You can also corrupt the memory by often applying filters and building and doing stuff. And at some point you get the error that preview cannot be shown because memory is out???
Do we have a leak???
Smashing Ctrl+F does not cause a leak
Smashing Ctrl+F does NOT cause a leak.
"Deleaker" tool only showed small leaks, nothing very big and no leaks with high hit-count!
 
Minor priority stuff or ideas
-----------------------------
 
* Should we completely remove all Apple code? It will make things much easier, and newer Apple ports need completely remake anyway. On the other hand, we lose a potential back port to ancient Mac.
 
* Right to the sliders you can enter numbers which are outside the range of 0..255 . Prevent that, please.
 
* Win95 cannot detect a 64 bit obfuscated filter, because it cannot read the resources. Should there be a different mechanism for detecting an obfuscated filter? (e.g. a signature in PiPL which can be found using binary search?)
35,7 → 37,7
 
* Memory leak: `strdup()` and `my_strdup()` need `free()` !
 
* Why can't we edit *.rc files in Visual Studio?
* Why can't we edit *.rc files in Visual Studio? (As text) Visual Studio 2022 crashes if you try to edit the code of win_res.rc
 
* `host_preserves_parameters` (enabled with GIMP/PSPI) should somehow delete the temporary AFS file at each restart of GIMP. Otherwise, the user would always see the previous session when they re-open GIMP.
 
45,7 → 47,7
* CMYK mode is possible (although a bit misleading to have r=c, g=m, b=y, a=k), but then it is impossible to control the alpha channel.
 
* I have found following in the source code... Do we need to do something here?
* I have found the following in the source code... Do we need to do something here?
 
strcpy(gdata->parm.formula[i],expr[i] ? expr[i] : "bug! see builddlgitem");
 
55,8 → 57,6
 
* Minor bug: Testcase testcases/rst_3.afs applied to a 1000x1000 canvas: When the preview is zoomed in to 29% or 59%, and the preview is panned, the bars change during panning. It does not look "smooth" like in 100%, 50%, or 25% zoom. The problem is that the offset of the preview area is always different, and if the zoom level is not a multiple of two, you will always "pick" other bars.
 
* Fast (double) click in [+]/[-] scroll buttons is not accepted as 2 clicks / zoom-requests
 
* Support more colors modes and 16bit. Why is Lab color not accepted, although doesSupportLABColor is set?
 
* Add Unicode support? (Does PiPL support Unicode at all?)
74,9 → 74,12
 
* Make Filter Foundry ready for translations? In Windows, put all strings in string lists (resources, `LoadStringA`), as well as in Mac resources.
 
* Should the compiler flags in `funcs.h` placed as resource (binary bits), so that the behavior can be changed if required?
* Should the compiler flags in `funcs.h` as well as settings like `use_plugin_dll_sliders` be placed as resource (binary bits), so that the behavior can be changed if required?
 
* Make some parts of the code Unicode aware. Note that Photoshop itself (PIPL etc) doesn't seem to be Unicode aware, and PARM is also not Unicode aware. So the Title/Category/... stays ANSI! But we should allow that filters are loaded/saved from File Dialogs that can read/save Unicode folder names.
=> Cancelled, because it is extremely heavy work!
 
 
Big ideas
---------
 
/trunk/ff.h
53,10 → 53,7
 
TEXT_FILETYPE = 'TEXT',
SIG_SIMPLETEXT = 'ttxt',
PS_FILTER_FILETYPE = '8BFM',
 
// Obfuscated data will be read, but it will not be read if it is additionally protected
READ_OBFUSC = 1
PS_FILTER_FILETYPE = '8BFM'
};
 
typedef struct{
145,7 → 142,7
 
// from loadfile_*.c
Boolean loadfile(StandardFileReply *sfr,char **reason);
Boolean readPARMresource(HMODULE hm,char **reason,int readobfusc);
Boolean readPARMresource(HMODULE hm,char **reason);
 
// from main.c
int64_t maxspace();
/trunk/load_mac.c
24,32 → 24,41
 
#include "file_compat.h"
 
Boolean readPARMresource(HMODULE hm,char **reason,int readobfusc){
Boolean readPARMresource(HMODULE hm,char **reason){
Boolean res = false;
Handle h;
 
if( !(h = Get1Resource(PARM_TYPE,PARM_ID_NEW))
&& !(h = Get1Resource(PARM_TYPE,PARM_ID_OLD))
&& readobfusc
&& ((h = Get1Resource(OBFUSCDATA_TYPE_NEW,OBFUSCDATA_ID_NEW)) ||
(h = Get1Resource(OBFUSCDATA_TYPE_OLD,OBFUSCDATA_ID_OLD))) ){
if( (h = Get1Resource(PARM_TYPE,PARM_ID_NEW)) ||
(h = Get1Resource(PARM_TYPE,PARM_ID_OLD)) )
{
HLock(h);
if(GetHandleSize(h) == sizeof(PARM_T)) {
deobfusc((PARM_T*)*h);
gdata->obfusc = true;
res = readPARM(*h, &gdata->parm, reason, 0 /*Mac format resource*/);
gdata->obfusc = false;
ReleaseResource(h);
} else {
// Obfuscated PARM has wrong size. Should not happen
// PARM has wrong size. Should not happen
gdata->obfusc = false;
ReleaseResource(h);
return false;
}
}
if(h){
else if( ((h = Get1Resource(OBFUSCDATA_TYPE_NEW,OBFUSCDATA_ID_NEW)) ||
(h = Get1Resource(OBFUSCDATA_TYPE_OLD,OBFUSCDATA_ID_OLD))) )
{
HLock(h);
if(GetHandleSize(h) == sizeof(PARM_T)) {
deobfusc((PARM_T*)*h);
res = readPARM(*h, &gdata->parm, reason, 0 /*Mac format resource*/);
gdata->obfusc = true;
ReleaseResource(h);
} else {
// Obfuscated PARM has wrong size. Should not happen
gdata->obfusc = false;
ReleaseResource(h);
return false;
}
}
if (!res) {
gdata->obfusc = false;
}
61,7 → 70,7
short rrn = FSpOpenResFile(&sfr->sfFile,fsRdPerm);
 
if(rrn != -1){
if(readPARMresource(NULL,reason,0))
if(readPARMresource(NULL,reason))
res = true;
CloseResFile(rrn);
}else
/trunk/load_win.c
38,7 → 38,7
else return true;
}
 
Boolean readPARMresource(HMODULE hm, char** reason, int readobfusc) {
Boolean readPARMresource(HMODULE hm, char** reason) {
HRSRC resinfo;
HANDLE h;
Ptr pparm;
54,7 → 54,7
return res;
}
}
else if (readobfusc &&
else if (
((resinfo = FindResource(hm, OBFUSCDATA_ID_NEW, OBFUSCDATA_TYPE_NEW)) ||
(resinfo = FindResource(hm, OBFUSCDATA_ID_OLD, OBFUSCDATA_TYPE_OLD)))) {
if ((h = LoadResource(hm, resinfo)) && (pparm = (Ptr)LockResource(h))) {
106,7 → 106,7
if (*reason == NULL) {
char name[MAX_PATH + 1];
if (hm = LoadLibraryEx(myp2cstrcpy(name, sfr->sfFile.name), NULL, LOAD_LIBRARY_AS_DATAFILE)) {
if (readPARMresource(hm, reason, READ_OBFUSC)) {
if (readPARMresource(hm, reason)) {
if (gdata->parm.iProtected) {
*reason = _strdup("The filter is protected.");
//gdata->parmloaded = false;
/trunk/main.c
241,7 → 241,7
gdata = (globals_t*)malloc(sizeof(globals_t));
if (!gdata) break;
gdata->hWndMainDlg = (HWND)((PlatformData*)((AboutRecordPtr)pb)->platformData)->hwnd; // so that simplealert() works
gdata->standalone = gdata->parmloaded = readPARMresource((HMODULE)hDllInstance,&reason,READ_OBFUSC);
gdata->standalone = gdata->parmloaded = readPARMresource((HMODULE)hDllInstance,&reason);
if (gdata->parmloaded && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) {
if (gdata->obfusc) {
simplealert(_strdup("Incompatible obfuscation."));
387,7 → 387,7
// We need to set gdata->standalone after loadfile(), but we must call readPARMresource() before loadfile()
// Reason: readPARMresource() reads parameters from the DLL while loadfile() reads parameters from the AFS file
// But loadfile() will reset gdata->standalone ...
isStandalone = readPARMresource((HMODULE)hDllInstance, &reason, READ_OBFUSC);
isStandalone = readPARMresource((HMODULE)hDllInstance, &reason);
if (isStandalone && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) {
if (gdata->obfusc) {
simplealert(_strdup("Incompatible obfuscation."));
433,7 → 433,7
or the parameter data couldn't be read; set default values */
 
// see if saved parameters exist
gdata->standalone = gdata->parmloaded = readPARMresource((HMODULE)hDllInstance,&reason,READ_OBFUSC);
gdata->standalone = gdata->parmloaded = readPARMresource((HMODULE)hDllInstance,&reason);
if (gdata->parmloaded && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) {
if (gdata->obfusc) {
simplealert(_strdup("Incompatible obfuscation."));
/trunk/screenshots/Windows 98.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/telegraphics_common/README.md
4,4 → 4,4
 
A modified version of SVN revision 84 (dated 9 October 2019) is included in
the Filter Foundry source repository to simplify the build process.
Files which are not used by Filter Foundry have been removed.
There were several improvements and files which are not used by Filter Foundry have been removed.
/trunk/telegraphics_common/tt/str.c
83,6 → 83,8
return p;
}
 
// DM 03.12.2021 removed, because it is not used in Filter Foundry
/*
unsigned char *PLcstrcpy(unsigned char *s1,const char *s2){
size_t n = strlen(s2);
if(n>255)
91,7 → 93,10
*s1 = (unsigned char)n;
return s1;
}
*/
 
// DM 03.12.2021 removed, because it is not used in Filter Foundry
/*
unsigned char *PLcstrcat(unsigned char * str1,const char * s2){
size_t n = strlen(s2);
if(str1[0]+n > 255)
100,3 → 105,4
str1[0] += (unsigned char)n;
return str1;
}
*/
/trunk/telegraphics_common/tt/str.h
28,10 → 28,12
//void *my_memset(void *dst, int val, size_t len);
char *my_strdup(char *s); // my_strdup() is like _strdup(), with the difference that it accepts "char*" instead of "const char*" as argument
 
unsigned char *PLcstrcat(unsigned char * str1,const char * s2);
unsigned char *PLcstrcpy(unsigned char *s1,const char *s2);
// DM 03.12.2021 removed, because it is not used in Filter Foundry
//unsigned char *PLcstrcat(unsigned char * str1,const char * s2);
//unsigned char *PLcstrcpy(unsigned char *s1,const char *s2);
 
// DM 03.12.2021 removed, because it is not used in Filter Foundry
/* in-place conversion from Pascal to C string */
#define INPLACEP2CSTR(s) ((s)[*(s)+1] = 0,(char*)(s)+1)
//#define INPLACEP2CSTR(s) ((s)[*(s)+1] = 0,(char*)(s)+1)
 
#endif
/trunk/wpj/README.md
45,11 → 45,8
pluginsdk\photoshopapi\photoshop\PITypes.h in your Adobe Photoshop SDK and
comment out the line "#include <sdkddkver.h> // for WINVER".
Alternatively, you can create an empty sdkddkver.h file in your wpj folder.
* In Open Watcom 2.0:
The error message has the error code E062.
Creating an empty sdkddkver.h does not work anymore.
You need to comment out the line in PITypes.h.
(Bug will be fixed: https://github.com/open-watcom/open-watcom-v2/issues/770 )
* Take care that the directory "." is added to the include path of the C-compiler
and the RC-compiler!
 
- It is important that the correct calling convention is used.
The calling convention needs to be set in