my $mainImg = $self->query->param('propImg'); my $id = $self->query->param('pId') || $self->param('DBH')->{mysql_insertid}; if ($mainImg) { warn " ( $id ) directory ... " . FINALDIR if DEBUG; my $utils = MLSUtils->new(); my $fsName = $utils->save_to_filesystem( $self->query, FINALDIR, 'propImg' ); my ( $base, $dir, $suffix ) = fileparse( $fsName, qr{\..*} ); my $newImgName = FINALDIR . "/LG${id}_0" . $suffix; warn "passing $newImgName to resizeImg " if DEBUG; $utils->resizeImg( $fsName, $newImgName, 1 ) or die "Resizing images failed! "; $sth = $self->param('DBH')->prepare( "UPDATE jbg_managed_props SET NumPhotos = 1 WHERE jbgPropertyID = ? " ); $sth->execute($id) if ( !$self->query->param('pId') ); } warn "back from images " if DEBUG;