$fix=1; use GD::Image; system("dir /b itemsquick > itemsquick.txt"); system("dir /b contentquick > contentquick.txt"); open(CONTENT,"contentquick.txt"); @content=; close(CONTENT); open(ITEMS,"itemsquick.txt"); @items=; close(ITEMS); open(PRODUCTS,"/aussie/2008/quick/products.txt"); @products=; close(PRODUCTS); open(PRODUCTSA,">/aussie/2008/quick/productsa.txt"); foreach $pr (@products) { chomp $pr; @arpr = split( /\t/, $pr ); $sku = $arpr[0]; $title = $arpr[1]; $description = $arpr[2]; $gst = $arpr[3]; $supplier = $arpr[4]; $price = $arpr[5]; $wholesale = $arpr[6]; $discount = $arpr[7]; $departments = $arpr[8]; $groups = $arpr[9]; $subgroups = $arpr[10]; $image = $arpr[11]; $size = $arpr[12]; $option_type = $arpr[13]; $gift_cert = $arpr[14]; $related = $arpr[15]; $featured = $arpr[16]; $url = $arpr[17]; $image_2 = $arpr[18]; $email_year = $arpr[19]; $inactive = $arpr[20]; $thumb = $arpr[21]; $shipping_rate = $arpr[22]; $comment = $arpr[23]; $quantity = $arpr[24]; $bullet_header = $arpr[25]; $bullet_one = $arpr[26]; $bullet_two = $arpr[27]; $bullet_three = $arpr[28]; $bullet_four = $arpr[29]; $bullet_five = $arpr[30]; $bullet_six = $arpr[31]; $bullet_seven = $arpr[32]; $bullet_eight = $arpr[33]; $bullet_nine = $arpr[34]; $bullet_ten = $arpr[35]; $bullet_eleven = $arpr[36]; $bullet_twelve = $arpr[37]; $bullet_thirteen = $arpr[38]; $bullet_fourteen = $arpr[39]; $bullet_fifteen = $arpr[40]; $bullet_sixteen = $arpr[41]; $weight = $arpr[42]; $model_number = $arpr[43]; $sale_price = $arpr[44]; foreach $c (@content) { chomp $c; $sk=$c; $sk=~s/\.txt//; $text=""; $file="/aussie/2008/contentquick/$c"; if ($sku eq $sk) { open(COM,"$file"); @com=; close(COM); foreach $l (@com) { chomp $l; $l =~ s/\n\r/\/g; $l =~ s/\n/\/g; $l =~ s/\r/\/g; $l =~ s/\n/\/g; $l =~ s/\t/ /g; $text=$text." ".$l; } $comment=$text; } } ######################### foreach $c (@items) { chomp $c; $sk=$c; $sk=~s/\..*$//; if ($sku eq $sk) { $imagefile=$c; if ( ( $imagefile =~ /jpg/ ) | ( $imagefile =~ /JPG/ ) | ( $imagefile =~ /jpeg/ ) | ( $imagefile =~ /JPEG/ ) ) { # LARGE JPG $file="/aussie/2008/largequick/$c"; $target_file=$file; $image="/aussie/2008/itemsquick/$c"; #require "/perl/site/lib/GD.pm"; $imagewidth=100; my $jpeg_quality = 60; #Quality my $max_sizex = $imagewidth; #max picturewith my $max_sizey = 800; #max pictureheight my $source_file = $image; my $jpeg_quality = 60; #Quality GD::Image->trueColor(1); #improves quality my $bildle = newFromJpeg GD::Image( $source_file, 1 ) || die "could not open image."; #Bild ffnen... ( my $width, my $height ) = $bildle->getBounds(); #Mae herausfinden... $imageheight = $imagewidth * $height / $width; my $bild = newTrueColor GD::Image( $imagewidth, $imageheight ); $bild->copyResized( $bildle, 0, 0, 0, 0, $imagewidth, $imageheight, $width, $height ); $bild->interlaced('true'); open( DATEI, ">$target_file" ) || die "could not write image: $!"; binmode DATEI; print DATEI ( $bild->jpeg($jpeg_quality) ); close(DATEI); # SMALL JPG $file="/aussie/2008/smallquick/$c"; $target_file=$file; $image="/aussie/2008/itemsquick/$c"; #require "/perl/site/lib/GD.pm"; $imagewidth=60; my $jpeg_quality = 60; #Quality my $max_sizex = $imagewidth; #max picturewith my $max_sizey = 800; #max pictureheight my $source_file = $image; my $jpeg_quality = 60; #Quality GD::Image->trueColor(1); #improves quality my $bildle = newFromJpeg GD::Image( $source_file, 1 ) || die "could not open image."; #Bild ffnen... ( my $width, my $height ) = $bildle->getBounds(); #Mae herausfinden... $imageheight = $imagewidth * $height / $width; my $bild = newTrueColor GD::Image( $imagewidth, $imageheight ); $bild->copyResized( $bildle, 0, 0, 0, 0, $imagewidth, $imageheight, $width, $height ); $bild->interlaced('true'); open( DATEI, ">$target_file" ) || die "could not write image: $!"; binmode DATEI; print DATEI ( $bild->jpeg($jpeg_quality) ); close(DATEI); $image=$c; $thumb=$c; } ####################### GIF if ( ( $imagefile =~ /\.gif/ ) | ( $imagefile =~ /\.GIF/ ) ) { # LARGE GIF $file="/aussie/2008/largequick/$c"; $target_file=$file; $image="/aussie/2008/itemsquick/$c"; #require "/perl/site/lib/GD.pm"; $imagewidth=100; my $source_file = $image; my $jpeg_quality = 60; #Quality GD::Image->trueColor(1); #improves quality open(SOURCE,"$source_file"); my $bildle = newFromGif GD::Image(\*SOURCE) || die "could not open image."; #Bild ffnen... ( my $width, my $height ) = $bildle->getBounds(); #Mae herausfinden... $imageheight = $imagewidth * $height / $width; my $bild = newTrueColor GD::Image( $imagewidth, $imageheight ); $bild->copyResized( $bildle, 0, 0, 0, 0, $imagewidth, $imageheight, $width, $height ); $bild->interlaced('true'); open( DATEI, ">$target_file" ) || die "could not write image: $!"; binmode DATEI; print DATEI ( $bild->png ); close(DATEI); # SMALL GIF $file="/aussie/2008/smallquick/$c"; $target_file=$file; $image="/aussie/2008/itemsquick/$c"; #require "/perl/site/lib/GD.pm"; $imagewidth=60; my $jpeg_quality = 60; #Quality GD::Image->trueColor(1); #improves quality open(SOURCE,"$source_file"); my $bildle = newFromGif GD::Image(\*SOURCE) || die "could not open image."; #Bild ffnen... ( my $width, my $height ) = $bildle->getBounds(); #Mae herausfinden... $imageheight = $imagewidth * $height / $width; my $bild = newTrueColor GD::Image( $imagewidth, $imageheight ); $bild->copyResized( $bildle, 0, 0, 0, 0, $imagewidth, $imageheight, $width, $height ); $bild->interlaced('true'); open( DATEI, ">$target_file" ) || die "could not write image: $!"; binmode DATEI; print DATEI ( $bild->png ); close(DATEI); $image=$c; $thumb=$c; } # PNG ################################################# if ( ( $imagefile =~ /png/ ) | ( $imagefile =~ /PNG/ ) ) { # LARGE PNG $file="/aussie/2008/largequick/$c"; $target_file=$file; $image="/aussie/2008/itemsquick/$c"; my $source_file = $image; #require "/perl/site/lib/GD.pm"; $imagewidth=100; my $source_file = $image; my $jpeg_quality = 60; #Quality GD::Image->trueColor(1); #improves quality my $bildle = GD::Image->newFromPng($source_file); ( my $width, my $height ) = $bildle->getBounds(); #Mae herausfinden... $imageheight = $imagewidth * $height / $width; my $bild = newTrueColor GD::Image( $imagewidth, $imageheight ); $bild->copyResized( $bildle, 0, 0, 0, 0, $imagewidth, $imageheight, $width, $height ); $bild->interlaced('true'); open( DATEI, ">$target_file" ) || die "could not write image: $!"; binmode DATEI; print DATEI ( $bild->png ); close(DATEI); # SMALL PNG $file="/aussie/2008/smallquick/$c"; $target_file=$file; $image="/aussie/2008/itemsquick/$c"; #require "/perl/site/lib/GD.pm"; $imagewidth=60; my $jpeg_quality = 60; #Quality GD::Image->trueColor(1); #improves quality my $bildle = GD::Image->newFromPng($source_file); ( my $width, my $height ) = $bildle->getBounds(); #Mae herausfinden... $imageheight = $imagewidth * $height / $width; my $bild = newTrueColor GD::Image( $imagewidth, $imageheight ); $bild->copyResized( $bildle, 0, 0, 0, 0, $imagewidth, $imageheight, $width, $height ); $bild->interlaced('true'); open( DATEI, ">$target_file" ) || die "could not write image: $!"; binmode DATEI; print DATEI ( $bild->png ); close(DATEI); $image=$c; $thumb=$c; } } } $comment=~s/’/'/g; $comment=~s/‘/'/g; if ($option_type eq "Quick") { #$option_type="Custom"; } if ($option_type eq "Custom") { $option_type="Quick"; } if ($image eq "") { $image="picture-coming-soon.jpg"; $thumb="picture-coming-soon.jpg"; } print PRODUCTSA "$sku $title $description $gst $supplier $price $wholesale $discount $departments $groups $subgroups $image $size $option_type $gift_cert $related $featured $url $image_2 $email_year $inactive $thumb $shipping_rate $comment $quantity $bullet_header $bullet_one $bullet_two $bullet_three $bullet_four $bullet_five $bullet_six $bullet_seven $bullet_eight $bullet_nine $bullet_ten $bullet_eleven $bullet_twelve $bullet_thirteen $bullet_fourteen $bullet_fifteen $bullet_sixteen $weight $model_number $sale_price\n"; $flag=""; #comment= "" ########## } $username = "aussie"; $password = "hlsupi"; use Net::FTP; $servername = "www.aussievitamin.com"; open( FTPDATA, ">ftpdata.txt" ); print FTPDATA "open $servername\n"; print FTPDATA "$username\n"; print FTPDATA "$password\n"; #print FTPDATA "quote PWD\n"; #print FTPDATA "quote PASV\n"; print FTPDATA "bin\n"; print FTPDATA "prompt\n"; #print FTPDATA "CWD /var/www/html/aussie/images/items\n"; print FTPDATA "cd /var/www/html/aussie/images/items\n"; print FTPDATA "lcd largequick\n"; print FTPDATA "mput *\n"; print FTPDATA "cd /var/www/html/aussie/images/thumb\n"; #print FTPDATA "CWD /var/www/html/aussie/images/thumb\n"; print FTPDATA "lcd ..\n"; print FTPDATA "lcd smallquick\n"; #print FTPDATA "quote PASV\n"; print FTPDATA "mput *\n"; print FTPDATA "bye\n"; close(FTPDATA); # DISABLED NEED TO UPLOAD IMAGES AND THUMBS #system("ftp -s:ftpdata.txt"); system("copy /b quick\\productsa.txt quick\\products.txt");