Changeset 1082


Ignore:
Timestamp:
2000-04-10T10:57:01+12:00 (24 years ago)
Author:
gwp
Message:

First, fixed bug in process_image_width regex (Trailing x is now optional, not required). Second, when making green_title images, read the desired width from the macro file and pass it to gimp/green_title.pl (default = 200)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/translate.pl

    r1081 r1082  
    203203    } elsif ($image_type eq "green_title") {
    204204
    205     # generate green title image
     205    # read the width if it is specified in $image_macros
     206        my ($width) = $image_macros =~ /_width${image_name}x?_\s*[^\{]*\{(\d+)\}/;
     207        $width = 200 unless ($width);
     208
     209        # generate green title image
    206210    my $options = "-text \"$text\" -filename ${image_name}.gif -image_dir $image_dir";
    207     $options .= " -width 200 -height 57 -stripe_alignment right -text_alignment right";
     211    $options .= " -width $width -height 57 -stripe_alignment right -text_alignment right";
    208212    $options .= " -fontsize 26 -fontweight bold";
    209213    `$ENV{'GSDLHOME'}/bin/script/gimp/title_icon.pl $options`;
    210214
    211     # get width of new images and edit width macro
    212     # we'll do this even though title_icon.pl will always create images of the
    213     # width specified (200)
    214     my $fullfilename = &util::filename_cat ($image_dir, "${image_name}.gif");
    215     &process_width_macro ($fullfilename, $image_name, \$image_macros);
     215    # get width of resulting image and edit _width..._ macro in $image_macros
     216        # (no longer needed since we always resize to the width read from $image_macros.)
     217        # my $fullfilename = &util::filename_cat ($image_dir, "${image_name}.gif");
     218    # &process_width_macro ($fullfilename, $image_name, \$image_macros);
    216219
    217220    } elsif ($image_type eq "hand_made") {
     
    232235
    233236    my $img_info = &get_img_info ($filename);
    234     $$image_macros =~ s/(_width${image_name}x_\s*(?:\[[^\]]*\])?\s*\{)(\d+)(\})/$1$img_info->{'width'}$3/s;
     237    $$image_macros =~ s/(_width${image_name}x?_\s*(?:\[[^\]]*\])?\s*\{)(\d+)(\})/$1$img_info->{'width'}$3/s;
    235238}
    236239
Note: See TracChangeset for help on using the changeset viewer.