我无法在codeigniter中调整图像大小

时间:2017-07-19 10:17:18

标签: php codeigniter

    $config['upload_path'] = './uploads/';
    $config['allowed_types'] = 'jpg|jpeg|png|gif';
    $config['maintain_ratio'] = TRUE;
    $config['width'] = 100;
    $config['height'] = 150;
    $config['file_name'] = $_FILES['image']['name'];
    $this->load->library('image_lib', $config);
    $this->image_lib->resize();
    $this->image_lib->initialize($config); 
    $this->load->library('upload',$config);
    $this->upload->initialize($config);
  

我无法调整图片大小...请告诉我我的错误

1 个答案:

答案 0 :(得分:0)

根据@jigar Shah评论,您必须先调整上传库的大小,然后再调整大小

    Observable<String> lineReader = Observable.<String>create(subscriber -> {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            for (String line = br.readLine(); line != null; line = br.readLine()) {
                subscriber.onNext(line);
            }
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }).subscribeOn(Schedulers.newThread());

    lineReader
      .buffer(5, TimeUnit.SECONDS,4)
      .filter(lines -> !lines.isEmpty())
      .subscribe(System.out::println);

如需更多参考,请visit

相关问题