Oh no, logarithmic distortion filter do crash. I’m not sure why it was working fine from my end until after the update.
#@cli rep_logpindis: (eq. to rep_logarithmic_pinching_distortion)
rep_logpindis: rep_logarithmic_pinching_distortion $*
#@cli rep_logarithmic_pinching_distortion: _distortion_main>=0,-1<=_preshift_x<=1,-1<=_preshift_y<=1,-1<=_effposition_x<=1,-1<=_effposition_y<=1,_prescale_x,_prescale_y,_afterscale_x,_afterscale_y,0<=_angle<=360,_mirror_placement= { 0=outside-in | 1=inside-out },_lx_axis= { 0=different axis | 1=same axis},_ly_axis= { 0=different axis | 1=same axis},ix_dir={ 0=negative | 1=positive },iy_dir={ 0=negative | 1=positive },_boundary= { 0=Periodic | 1=Mirror },1<=_interpolation<=5,_dimension_ref>0
rep_logarithmic_pinching_distortion:
skip ${2=0},${3=0},${4=0},${5=0},${6=1},${7=1},${8=1},${9=1},${10=0},${11=0},${12=1},${13=0},${14=1},${15=0},${16=0},${17=5},${18=1024}
if $6==0||$7==0||$8==0||$9==0 v + error "Scale cannot be 0!" v - fi
if $17<1 v + error "interpolation cannot be less than 1" v - fi
shift {50*$2}%,{50*$3}%,0,0,3,1
f "
sd=w/h;
ang=pi*($10/180);
ox=$4*-1;
oy=$5;
ox/=h>w?1/sd:1;
oy/=w>h?sd:1;
OX=ox*cos(ang)-oy*sin(ang);
OY=ox*sin(ang)+oy*cos(ang);
ox=OX;
oy=OY;
ix=((x/w)-.5)/(h>w?1/sd:1);
iy=((y/h)-.5)/(w>h?sd:1);
IX=ix*cos(ang)-iy*sin(ang);
IY=ix*sin(ang)+iy*cos(ang);
ix=IX;
iy=IY;
ix=abs(ix+ox/2)*$6;
iy=abs(iy+oy/2)*$7;
ed=int(abs($18));
ed/=2;
ix*=ed;
iy*=ed;
lx=ix==0||iy==0?log(10^-8)*$1:log($12?iy^2:ix*iy)*$1;
ly=iy==0||iy==0?log(10^-8)*$1:log($13?ix^2:ix*iy)*$1;
dx=($14?1:-1);
dy=($15?1:-1);
ix-=lx*dx;
iy-=ly*dy;
ix*=w/ed;
iy*=h/ed;
ix*=$8;
iy*=$9;
i(ix,iy,z,c,$17,($16?3:2));
"
if $11 shift 50%,50%,0,0,3,1 fi
Here’s the code. I don’t see div by 0 anywhere or inf anywhere.
@David_Tschumperle : Did I discovered a bug? @Joan_Rake1 didn’t find anything wrong. And it seem a programmer in Paint.NET
forum didn’t find anything wrong either.