I will do 20 to 150 photos background removal and crop image for $5

I will do 20 to 150 photos background removal and crop image


Hi, this is MEHEDY, I am a professional Retouching, Photo Editing Expert.

I have a team. We are providing any photo editing services every time

Top 06 Reasons to Hire Me :

01. More Selling of products
02. World-class Quality
03. Cheap Prize
04. 100 % Customer satisfaction
05. 100 % Money Back guaranteed
06. Unlimited Revision


  • Background Change to White/Transparent you want.
  • Object Remove (which you need).

Hey! let me know if you have any job that not matching with the above services, But don’t worry will try to serve it.

Thank You

Mehedy HASAN


8 – Add a hero image and text when a node goes from unpublished to published

I’m trying to add a hero image and text when a node goes from unpublished to published. The things include:

  1. Add an image from my media library to a media field on the node
  2. Add a page title to the node, drawing upon a field already saved on the node

I’m attempting to build a hook on hook_node_update() but it’s not working. I’m not sure why.

The code I am using, part of the running_event_adding_header.module file, is the following.

namespace DrupalCoreFieldEntityReferenceFieldItemList;
namespace DrupalnodeEntity;

 * Implements hook_node_update()
function running_event_adding_header_node_update(DrupalCoreEntityEntityInterface $entity) {
  // End function if the entity is not an event
  if ($entity->bundle() !== 'event') {
  // End function if the event is not a running type of event (running events are '30' in my system)
  if ($entity->bundle() === 'event' && $entity->get('field_event_type')->getString() != '30') {

  // Check if the new state is "published" and the old state was something other than "published".

  if ($entity->get('moderation_state')->getString() === 'published') {

    * Add hero image and text to running event page, if not already present
    * The hero image field is 'field_hero_image'
    * The hero text field is 'field_tagline'

    if ($entity->get('field_hero_image')->isEmpty()) {
      $media = Media::load(53); // 53 is the media ID for the image I'm wanting to load on all running pages: .../media/53/edit
      $entity->set('field_hero_image', $media);

    //'field_tagline' is the hero title field
    if ($entity->get('field_tagline')->isEmpty()) {
      $entity->set('field_tagline', $entity->label());
}//close function

Why is JPEG the only compressed image choice in most digital cameras?

I’ve been viewing, editing, and storing digital images since before digital cameras were common — I’ve used GIF, JPEG, TIFF, PNG, and a few other now-obsolete formats.

GIF has been mainly relegated to animated images, because nearly any other compressed format produces smaller files (but only GIF has the ability to display multiple frames sequentially, even loop the display, built into the format spec). TIFF is mainly used for images to be stored in documents like PDF or word processor files, and PNG is the “new kid on the block” with exceptionally high efficiency and lossless compression (at least up to some point).

So, PNG is clearly superior to JPEG, both in terms of preserving image quality, and in actual compression level — yet digital cameras seem to either save only in JPEG or give a choice of some uncompressed RAW format, with or without simultaneous JPEG.

Why haven’t cameras adopted the superior PNG compression technology, which would fit more, higher quality images on a memory card and largely (if not completely) eliminate the need for dual-format storage?

file – Image upload filter for PHP

I am trying to improve my file upload handler filter.


Since any client-side validation is easily circumvented, there is none in this code, for ease of testing. Not even an accept="image/*" on the <input> element. Production code will include some client side validation.

The upload handler is set up to first check that the standard php file upload criteria are met, and then goes on to validate that the upload file is an image and can be saved.

The Error handler is simplifiedl


I realized that my handler was vulnerable after completing the upload vulnerabilities room in tryhackme since I originally only checked the extension and the mime type.

Known possible pitfalls:

  • nono-image files like.php can still be uploaded with null char in name .php%00.png with a spoofed header (e.g. image/png instead of application/x-php), but must have correct magic number.
  • No check of whether the header matches the extension.
    • Fix1: scan for strings like /bin/bash and <?php?
    • check for null bytes in file names?

I put the code on github as well…

function is_image($filename) {
    // PNG, GIF, JFIF JPEG, EXIF JPEF (respectively)
    $allowed = array('89504E47', '47494638', 'FFD8FFE0', 'FFD8FFE1');

    $handle = fopen($filename, 'r');
    $bytes = strtoupper(bin2hex(fread($handle, 4)));

    return in_array($bytes, $allowed);

$resize = filter_input(INPUT_POST, "resize", FILTER_SANITIZE_STRING);
$resize = (boolean) $resize;
//flag to indicate whether we would have saved the file...
$file_ok = false;
$preliminary_check = true;

//Preliminary check of basic PHP file handling
if ($_FILES("inageFile")("error") != 0) {
    switch ($_FILES("inageFile")("error")) {
        case UPLOAD_ERR_INI_SIZE: //1
            error_log("File is too big. uploaded: " . $_FILES("inageFile")("size") . ")");
            $preliminary_check = false;
        case UPLOAD_ERR_FORM_SIZE: //2
            error_log("Form is too big, " . $_FILES("inageFile")("size") . ")");
            $preliminary_check = false;
        case UPLOAD_ERR_PARTIAL: //3
            error_log("Partial Error");
            $preliminary_check = false;
        case UPLOAD_ERR_NO_FILE: //4
            error_log("No file uploaded");
            $preliminary_check = false;
            error_log("Unknown error " . $_FILES("inageFile")("error"));
            $preliminary_check = false;

//if no errors, continue
if ($preliminary_check) {
    echo "PASSED preliminary checkn";
    if (substr($_FILES("inageFile")("type"), 0, 6) == "image/") {
        if (is_image($_FILES("inageFile")("tmp_name"))) {
            $im("filename") = str_replace(" ", "-", $_FILES("inageFile")("name")); //replace spaces with hyphens
            $im("size") = $_FILES("inageFile")("size");
            list($im("width"), $im("height"), $im("type"), $tempattr) = getimagesize($_FILES("inageFile")("tmp_name"));
            $im("type") = $_FILES("inageFile")("type");
            if (!file_exists($uploadfile)) {
                error_log($_FILES("inageFile")("name") . " will not overwrite existing Logo. Would be saved.");
                //if (move_uploaded_file($_FILES("inageFile")("tmp_name"), $uploadfile)) {
                error_log($_FILES("inageFile")("name") . " has been confirmed to be an image and would have been saved on the server.");
                $file_ok = true;
            //} else {
            //    error_log("Error in file upload. " . $_FILES("inageFile")("tmp_name") . " cannot be moved to $uploadfile");
            } else {
                error_log("filename exists already");
        } else{
            error_log($_FILES("inageFile")("type") . " does not match magic number");    
    } else {
        error_log("Mime/type is not an image - received: " . $_FILES("inageFile")("type"));

    if($file_ok) {
    }else {
        echo "FAILED image check";
} else {
    echo "FAILED preliminary check";

command line – Error 137 when build docker image locally from node app on Ubuntu 20.04

i’m having a trouble when i build a docker image locally. This is the build

   FROM node 
   WORKDIR /home/node/unqfy
   COPY package.json .
   COPY package-lock.json .
   RUN ["npm", "install"]
   EXPOSE 5001
   COPY . /home/node/unqfy/
   RUN chown -R 777 /home/node/unqfy
   CMD [ "node", "./src/API/requests/router.js" ]

Obviusly it’s a node app. But when it comes to the npm install line it returns a 137 error, which implies that it reaches the RAM limit as investigated. The thing is that i use Ubuntu 20.04 and, unlike windows, it is not necessary to specify how much memory docker can use, it is dynamic and therefore there is not a config for that in ubuntu. I couldnt find anything refered to this error given in the image build process, contrary when a container is setted up, this error is much less common. I run the docker info command an saw that the Total Memory part have all the RAM that i have in my system. Previously i change the default directory where docker allocate images to a completly different partition, i am using the /mnt/UNQ/docker-final/ directory and i configure the root-dir param in the daemon.json file whit that path. I’ve done that ’cause i am running out of storage in the partition where docker stores the images by default. Here is the console output

The command 'npm ci' returned a non-zero code: 137 The terminal process "zsh '-c', 'docker build --pull --rm -f "UNQfy-Service/Dockerfile" -t service:unqfy "UNQfy-Service"'" terminated with exit code: 137.

How to download an image in magento 1.9 using _prepareDownloadResponse

I am trying to download a .png that i saved in Magento. At the moment i am using :

    $this->_prepareDownloadResponse($fileName, array('type' => 'filename', 'value' => $path));

It does download the file but when I am trying do open it, it says: It looks like we don’t support the file format.

I tried to give the $contentType = image/png instead of $contentType = ‘application/octet-stream’ but that didnt seem to make a difference.

How can I download and open a png in Magento 1.9?

The function works for a .pdf but I also need it to work for .png and .jpg

Can’t get docker image owasp/modsecurity-crs:apache reverse proxy to work

I have an endpoint https://my-portal.nl and I wan’t to place a WAF with the OWASP Core rule set before it. So I found a Docker image(owasp/modsecurity-crs:apache) that can proxy all the requests to my endpoint (https://my-portal.nl). For some reason I can’t get it to work. When I browse for https://localhost I’m getting a

“Forbidden You don’t have permission to access this resource.”
response from the server.

This is the command I executed:

docker run -dti 
  --name apachecrs 
  --env PARANOIA=1 
  --env ANOMALYIN=5 
  --env ANOMALYOUT=5 
  --env MAX_FILE_SIZE=5242880 
  --env PROXY=1 
  --env PORT=8443 
  --publish 443:443 
  --env BACKEND=https://my-portal.nl:8443 

What am I doing wrong?

permissions – POST Product Image w/ REST API Exception

I have Magento running in a Bitnami Docker container, and
trying to upload an image for a product using the REST API causes an exception.

I initially suspected a permissions error, so the following subdirectories of the Magento installation are CHMOD 777:

Please note I’ve removed the base64 encoded image data from the code snippet below in order to keep this post short and readable.

Not sure what else to look for – a config option maybe?.
Any pointers in the right direction appreciated.

Data I’m sending to server:

    "entry": {
        "content": {
            "base64_encoded_data": ***(IMAGE DATA SUPPLIED HERE, NOT SHOWN)***,
            "name": "Mizuno-2.jpg",
            "type": "image/jpeg"
        "disabled": false,
        "file": "Mizuno-2.jpg",
        "id": 0,
        "label": "Mizuno 2",
        "media_type": "image",
        "position": 1,
        "types": (


2021-07-26:23:25:27,818 DEBUG    (connectionpool.py:0452) http://localhost:8080 "POST /rest/V1/products/Mizuno-2/media HTTP/1.1" 500 104
<Response (500)>
    "message": "Internal Error. Details are available in Magento log file. Report ID: webapi-60ff4467c74b8"

Server Log Exception Message:

(2021-07-26 23:25:27) main.CRITICAL: Report ID: webapi-60ff4467c74b8; Message: Notice: file_get_contents(): file created in the system's temporary directory in /bitnami/magento/vendor/laminas/laminas-http/src/PhpEnvironment/Request.php on line 96 {"exception":"(object) (Exception(code: 0): Report ID: webapi-60ff4467c74b8; Message: Notice: file_get_contents(): file created in the system's temporary directory in /bitnami/magento/vendor/laminas/laminas-http/src/PhpEnvironment/Request.php on line 96 at /bitnami/magento/vendor/magento/framework/Webapi/ErrorProcessor.php:208, Exception(code: 0): Notice: file_get_contents(): file created in the system's temporary directory in /bitnami/magento/vendor/laminas/laminas-http/src/PhpEnvironment/Request.php on line 96 at /bitnami/magento/vendor/magento/framework/App/ErrorHandler.php:61)"} ()

html – Must the image url in a sitemap file begin with the same domain the file is stored on?

I remember when making a sitemap, all URLs defined in between <loc> and </loc> must be part of the same domain as the domain the file is stored on. For example, I can use this line in my sitemap…


…Only if the sitemap is stored on and publicly accessible from the folder mapped to the an.example.com domain.

But that entry above won’t work if the sitemap is stored on a folder representing a different domain such as y.example.com or even domain.com.

My question is, should I use the above thinking when trying to index for Google images? For example, do image URLs defined in <image:loc> and </image:loc> have to contain the same domain as the location of the sitemap file the entries are contained in?

The reason why I ask is because I have two subdomains. Let’s call them t.example.com and i.example.com. T is for text, and I is for images.

My site map for one page currently would look like something as follows:

<image:title>Some image</image:title>

Am I wrong with using a different subdomain to reference the image? Assume the sitemap file is stored and accessed at http://t.example.com/sitemap.xml

php – Add Featured Image to Existing Post

I have already created thousands of product as posts (CSV Import). They have a custom post type. Now, I would like to assign featured image to each existing post programmatically (without manually entering each post and setting the featured images more than 3,000 times).

Additional info:

  • Import plugin have not worked out, so I cannot attach the images using CSV import.
  • I use a custom field called ‘ean’ with each prduct, and it is standing as the unique serial number. It is an interger, for example: “5999626322456”. The same interger is standing for name of the image (i.e. 5999626322456.jpg).

What code do you recommend to use? I tried these two (among many), but they do not work. What do I do wrong?

function set_post_thumbnail( $post, $thumbnail_id ) {
    $post    = get_post( $post );
    $ean_url = rwmb_get_value( 'ean' );
    $kep_url = $ean_url . '.jpg';
    $thumbnail_id = attachment_url_to_postid( $kep_url );
    if ( $post && $thumbnail_id && get_post( $thumbnail_id ) ) {
        if ( wp_get_attachment_image( $thumbnail_id, 'thumbnail' ) ) {
            return update_post_meta( $post->ID, '_thumbnail_id', $thumbnail_id );
        } else {
            return delete_post_meta( $post->ID, '_thumbnail_id' );
    return false;

// Add Featured Image to Post

$ean_url          = rwmb_get_value( 'ean' );
$image_url        = '/wp-content/uploads/' . $ean_url . '.jpg'; // Define the image URL here
$image_name       = $ean_url . '.jpg';
$upload_dir       = wp_upload_dir(); // Set upload folder
$image_data       = file_get_contents($image_url); // Get image data
$unique_file_name = wp_unique_filename( $upload_dir('path'), $image_name ); // Generate unique name
$filename         = basename( $unique_file_name ); // Create image file name

// Check folder permission and define file location
if( wp_mkdir_p( $upload_dir('path') ) ) {
    $file = $upload_dir('path') . "https://wordpress.stackexchange.com/" . $filename;
} else {
    $file = $upload_dir('basedir') . "https://wordpress.stackexchange.com/" . $filename;

// Create the image  file on the server
file_put_contents( $file, $image_data );

// Check image file type
$wp_filetype = wp_check_filetype( $filename, null );

// Set attachment data
$attachment = array(
    'post_mime_type' => $wp_filetype('type'),
    'post_title'     => sanitize_file_name( $filename ),
    'post_content'   => '',
    'post_status'    => 'inherit'

// Create the attachment
$attach_id = wp_insert_attachment( $attachment, $file, $post_id );

// Include image.php
require_once(ABSPATH . 'wp-admin/includes/image.php');

// Define attachment metadata
$attach_data = wp_generate_attachment_metadata( $attach_id, $file );

// Assign metadata to attachment
wp_update_attachment_metadata( $attach_id, $attach_data );

// And finally assign featured image to post
set_post_thumbnail( $post_id, $attach_id );