Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6877629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:37:24+00:00 2026-05-27T04:37:24+00:00

I want to use imagecache Actions module to create image overlays. The user should

  • 0

I want to use imagecache Actions module to create image overlays. The user should upload one image and I want to scale and crop it and then overlay a transparent PNG over it.

I have installed drupal 6 and ImageCache and ImageCache Actions modules. ImageCache Actions defines the imageapi_image_overlay function.

I have created a ImageCache Preset with the name 590x160_Newsletter to scale and crop the image.

Image Tool is GD

Heres what I want to do: User uploads an image. This Image is scaled and cropped with the ImageCache preset. Then I want to overlay it with an image (PNG with transparency). I cannot choose this to be in the preset, because it depends on some other settings in the node, which overlay image I want to use.

The scale and crop does work good, but the $image2 after calling imageapi_image_overlay is still the same (same path, same image) though it says ‘success’. But it should be altered like the API reference says

Here is a test code

/* PHP */
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

print "<body style=\"background: lightgreen\">";
$path = "path/to/source/image.jpg";
$opath = "path/to/overlay/image.png";
print '<xmp>';
$image = imageapi_image_open($path);
print '$image: ' . print_r($image,1) . "\n";

$image2 =imageapi_image_open(imagecache_create_path('590x160_Newsletter',  $path));
print '$image2: ' . print_r($image2,1) . "\n";

$overlay = imageapi_image_open($opath);
print imageapi_image_overlay($image2, $overlay, 0, 0, 100, TRUE) ? "success\n" : "failure\n";

print '$image2 after: ' . print_r($image2,1) . "\n";
print '$overlay: ' . print_r($overlay,1) . "\n";
print '</xmp>';
print "<img src=\"$image->source\" />";
print "<img src=\"$image2->source\" />";
print "<img src=\"$overlay->source\" />";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:37:25+00:00Added an answer on May 27, 2026 at 4:37 am

    I found out:

    You have to save the image for yourself:

    The Object $image2 has two significant elements: $image2->source which is the filename of the original image and $image2->resource which is the file resource, that is the PHP image resource. This resource is altered in the process, but not saved to disk.

    imagejpeg ($image2->resource, $images2->source); will save the file as JPG under the same name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some properties defined by the user, and then I want use them
I want use from multiple upload image in codeigniter but problem is here that
in my app i want use the camera for capturing image and send to
My question here is why should i want use the entity framework instead of
I want use $.ajax get a url string from a xml file ,then with
i want use single quotations inside a transact sql statement, then execute that statement.
I want use groovy findAll with my param to filtering closure filterClosure = {
i want use some data from a website with web service. i have a
I have a transaction log file in CSV format that I want use to
Below is my stored procedure. I want use stored procedure select all row of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.